I disagree that setValue/getValue style accessors are better than jQuery-style value()/value(10) accessors. They add unnecessary name length, and require twice as many function definitions.
Admittedly, it's slightly faster for a VM to deal with functions that always return a single value type, as opposed to sometimes returning a type and sometimes returning nothing. But it's also slightly faster to download scripts using jQuery-style accessors, because the function keyword, prototype keyword, and public property names are unminifiable -- and we've yet to run into issues where our JS was too slow (whereas we do run into issues where our files are too big). If we have to compromise in one direction, I'd lean towards filesize over VM execution speed.
Additionally: the setters can still return a value, despite being "only" setters. Which means the VM executes just as quickly as it normally does.
It's also just less typing.
I disagree that
setValue/getValuestyle accessors are better than jQuery-stylevalue()/value(10)accessors. They add unnecessary name length, and require twice as many function definitions.Admittedly, it's slightly faster for a VM to deal with functions that always return a single value type, as opposed to sometimes returning a type and sometimes returning nothing. But it's also slightly faster to download scripts using jQuery-style accessors, because the
functionkeyword,prototypekeyword, and public property names are unminifiable -- and we've yet to run into issues where our JS was too slow (whereas we do run into issues where our files are too big). If we have to compromise in one direction, I'd lean towards filesize over VM execution speed.Additionally: the setters can still return a value, despite being "only" setters. Which means the VM executes just as quickly as it normally does.
It's also just less typing.