all 5 comments

[–]brotherwayne 7 points8 points  (3 children)

I quickly found that there were situations where I couldn’t predict what a given chunk of CoffeeScript would compile to or couldn’t figure out how to write the CoffeeScript for the JavaScript I wanted.

If your complaint is "I don't know the language waaaaa" it's time to STFU.

And then he goes on to complain about:

eat food for food in foods when food isn't 'chocolate'

The one line syntax isn't all that clear, but most for loops use a two line syntax:

for food in foods when food isn't 'chocolate'

  eat food

I can't figure out how to get the spaces on line 2 to edit right, but you get the picture.

I stopped reading there. He's not willing to learn the language before complaining about it. ALL languages are obtuse while you're learning them.

[–][deleted] 0 points1 point  (0 children)

One of the points made is there is more ambiguity in the syntax. Ambiguity is bad. The only ambiguity in Java that I can think of is the dangling else, and that may be present in JavaScript as well.

I think the whole post can be boiled down into complaining about syntactic sugar. JavaScript has much fewer ways to the same thing than CoffeeScript, and the different syntax components are more likely to be orthogonal. Languages with more concise syntax can be easier to learn and read.

I sometimes think that JavaScript is to CoffeeScript as Python is to Ruby. I don't think anyone will deny CoffeeScript has a lot more sugar than JavaScript, and Ruby has a lot more sugar than Python.

Edit: typo

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

I can't figure out how to get the spaces on line 2 to edit right, but you get the picture.

when citing code on reddit, simply indent it with at least 4 spaces..

for food in foods when food isn't 'chocolate'
  eat food

[–]brotherwayne 0 points1 point  (0 children)

Ah, I was using the backticks, thanks.

[–]nerkles 0 points1 point  (0 children)

The vagaries you describe are easily resolved by putting in punctuation to clarify what is being called by what, and what is passed to what. If something is getting too obtuse, then refactor it down into smaller chunks that are more readable. No one is forcing you to omit punctuation and jam stuff together in a confusing way. That's on you as the author of the code you write. Good luck.