4 ms·
Where does the author get the idea that JavaScript is easy? As a Ruby and Node developer, JS is much harder. Fewer libraries, less syntactic sugar (e.g. 3.hours
by naz 16y ago
Where does the author get the idea that JavaScript is easy? As a Ruby and Node developer, JS is much harder. Fewer libraries, less syntactic sugar (e.g. 3.hours.ago, 3.times) and a prototype object system.
- rue 16y agoIn interest of precision, those are methods, not syntactic sugar.
- Groxx 16y agoand they can be implemented almost identically in Javascript (just use 3.hours().ago() - each one can return a useful value, and have helper methods just like Ruby.)
- catch23 16y agoalthough 3.times is probably harder since all ruby methods take an implicit block as last parameter. The prettiest code you could do in node would be 3.times(function(){/code/}) It would be nice if js could rid of the keyword 'function' -- maybe make it a bit shorter like in coffeescript.
- mrspeaker 16y ago"function" will be gone soon enough - replaced (ok, augmented) in the next version of JS with "#" - so you'll be able to write: #(x) { x * x } instead of function(x){ return x * x; } http://brendaneich.com/2011/01/harmony-of-my-dreams/ http://brendaneich.com/2011/01/harmony-of-my-dreams/ (He indicates that the function change will land in this ((very good)) podcast: http://www.aminutewithbrendan.com/pages/20110303 http://www.aminutewithbrendan.com/pages/20110303)