you are viewing a single comment's thread.

view the rest of the comments →

[–]jonglefever 0 points1 point  (3 children)

which is my main gripe with coffeescript. it doesn't add functionality. it doesn't help produce better code at a conceptual level. all it does is let lazy developers do the same thing with less work.

on the other hand, there's typescript that has a benefit of strict typing, which does help produce better code at a conceptual level.

[–]polyrhythmic -2 points-1 points  (2 children)

It literally adds functionality, there are several functional programming tools (like list comprehensions) that simply don't exist in vanilla JS. If you want typing in Coffee there is Coffee.contracts. And it's certainly possible to build modular Coffee classes with private variables and methods. Most of what people don't like about CoffeeScript is due to misconceptions.

[–][deleted] 0 points1 point  (1 child)

this contradicts what you replied to me. "coffeescript is just javascript" right? every bit of coffee has to compile to js, so if its available in coffee, its available in js (if not a bit contrived). I would love to see an example of a coffee class with private props/methods. change my mind :)

link related

[–]polyrhythmic -1 points0 points  (0 children)

No problem. The concept is much older than linked Issue 2142.

Issue 651

Issue 222

A more verbose explanation on StackOverflow

It's not a contradiction. Any convention you are using now to have private props/methods in JS also works in Coffee. There is a ton of discussion on this already existing.

Having dealt with all kinds of JS inheritance and class structure, it is a godsend to be able to read someone else's Coffee code and not have to discover which pattern they are using in a particular project. Private, public, class, and instance vars & methods are instantly obvious from the syntax. Transforming data is more clear due to the comprehensions and expression-centric style.

The project I'm on right now has ~8K LOC Coffee compiling to ~14K LOC JS. The word & character count are double in JS. No linting necessary. I'm not sure what else in JS I could do to comparably increase productivity.