Hacker News new | ask | show | jobs
by epidemian 4518 days ago
> Part of the thing about CoffeeScript, is that there are more bad parts that it introduces than prevents.

I'm not sure about that; it prevents many of JS's ugly quirks: http://arcturo.github.io/library/coffeescript/07_the_bad_par... ;)

> Cleaning up the class model is generally not a good thing, since JavaScript isn't designed to have true OOP principles.

I really don't understand this. What does "true OOP principles" mean? Objects are so central to JavaScript that it has a concise syntax for object literals. It even goes to the extent of having a dynamic "this" to let any function work as a method in an object.

It has its rough edges (like primitives), yes, but they don't make it a non "true OO" language (whatever that means) IMO.

> [...] it's expressive for loops [...] shun people from using ES5 array methods like .forEach, .map, and .filter, which are a lot cleaner and more optimizable by the engine.

Thay are cleaner in the compiled JS, but Coffee's for loops are quite clean too, and they don't require a nested closure ;)

And, although i would also like native Array#forEach et al to be faster than manual for loops, that hasn't been the case in modern JS VMs: http://jsperf.com/for-vs-foreach/75

1 comments

I think you're referring to OOP in the literal, "program uses objects so it's object-oriented" sense, whereas parent is referring (more accurately, IMO) to the common, "classical" understanding of OOP as implemented in Java/Python/Ruby. When people say OOP, that is what they are referring to, and in that sense parent is correct, JavaScript is not really OOP. And in the broader JS community, heavy use of OOP is very uncommon.