var $buttons = $('.button');
. In my opinion the dollar sign really hurts the readability of the code.
Some developers claim that adding the dollar sign is a good naming convention because it shows that the value represents a jQuery object. If that's the case, then everybody should start using Hungarian notation all of the time. Gross.
The one exception I might make is for
var $this = $(this);
, although even then I would rather prefer something like var me = $(this);
.
Long story short, don't prefix your variables with a dollar sign. Besides, it's not like you're working with PHP or anything.
Agree on the naming convention, but disagree on the exception. var $this could lead to some problems if you're not paying attention. var me = $(this) is much better.
ReplyDeleteSoooooo, it's solely based in your opinion.... ok
ReplyDeleteI appreciate your opinion and apparently is the better way to maintain a clean code.
ReplyDelete