Joined March 2014
·
Achievements
69 Karma
0 Total ProTip Views
 
Altruist
Increase developer well-being by sharing at least 20 open source projects
 
Python
Would you expect anything less? Have at least one original repo where Python is the dominant language
 
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
 
Forked
Have a project valued enough to be forked by someone else
 
Charity
Fork and commit to someone's open source project in need
 
Bear
Have at least one original repo where Objective-C is the dominant language
 
Kona
Have at least one original repo where CoffeeScript is the dominant language
 
Hi Rashmi, I am happy to see you use CoffeeScript for your projects. Couple comments on your blogpost:
Using standalone
@instead ofthisis generally discouraged in the community.x if a is onwhereais a boolean is an antipattern (as opposed tox if a), unless you are not sure thatais indeed a boolean - it just struck me in the example.The
?=operator doesn't do what you probably assume it does - it checks the left hand side operand's value for existence and if the value is null or undefined assigns to it the right hand side. The codealert('rays') if(a?=0)would assign toa0if a was undefined and then not alert becauseifevaluates0asfalse. You also don't need the parentheses around theifcondition.Hope this clears some things up! Best of luck in your CoffeeScript ventures!