4 ms·
Perhaps the author meant for those who know Ruby: - @ for instance variables - #{} interpolation and Python: - for comprehensions - significant whitespace
by timruffles 15y ago
Perhaps the author meant for those who know Ruby:
- @ for instance variables
- #{} interpolation
and Python:
- for comprehensions
- significant whitespace
- mseebach 15y agoThose are syntactic sugar. If your devs have trouble understanding JavaScript because of this, I suggest your devs aren't very good.
- dpritchett 15y agoThe list comprehension syntax can be a bit confusing at first, especially if they're nested. When I first saw them I just asked jashkenas in #coffeescript and then it made sense. Later I came to appreciate them in Python. Coincidentally I learned Ruby-style string interpolation from CoffeeScript before trying Ruby.
- raganwald 15y agoI don't think all features are "just" syntactic sugar: http://weblog.raganwald.com/2007/04/writing-programs-for-people-to-read.html http://weblog.raganwald.com/2007/04/writing-programs-for-peo... Everyone parrots the line that programs should be written for people to read. I agree, and that's exactly why I use CoffeeScript: All of the devs in our office read and write JavaScript fluently, but code written in CoffeeScript is easier to read than code written in JavaScript.
- mseebach 15y agoYes, certainly. But the issue was whether these features makes CoffeeScript inherently more readable than JavaScript to a Ruby developer.
- karterk 15y ago> but code written in CoffeeScript is easier to read than code written in JavaScript. To be fair, that's a personal preference as well. For e.g. some people prefer reading code with symbols (&&, ||) than English keywords (and, or). Also, I have seen people from a C/C++ or Java background find JS easier to read than CS.