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.
ReplyDeleteI was actually looking for this resource a few weeks back. Thanks for sharing with us your wisdom.This will absolutely going to help me in my projects .
ReplyDelete----------------------------------------------------------
Flower Girl Dresses|Empire Wedding Dresses|New Style Wedding Dresses
Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.
ReplyDeletehtml5 player