4 ms·
This post is not javascript, it is coffeescript. Stop confusing the two.
by shtylman 13y ago
This post is not javascript, it is coffeescript. Stop confusing the two.
- ben336 13y agoFrom Coffeescript's website: The golden rule of CoffeeScript is: "It's just JavaScript". There was nothing at all coffeescript specific about his examples, other than the syntax. The issues he pointed out were javascript issues discussed using coffeescript syntax.
- Stratoscope 13y agoHe could have, and should have, used JavaScript for those examples. Otherwise it's needlessly confusing. Not every JavaScript developer knows CoffeeScript. What possible benefit could there be in using CoffeeScript instead of JavaScript in an article about JavaScript?
- ibrahima 13y agoAlso, I feel like the misunderstandings he posted are somewhat from the perspective of Ruby developers who learned CoffeeScript and not JavaScript. Which I do fall under, but I guess I quickly picked up the quirks in the language which CoffeeScript does make nicer. I guess things like `this` are a problem regardless of how you spell it but I think someone who learned JavaScript properly would learn about the scope rules directly rather than just assuming "it works like Ruby" and then being angry when it doesn't.
- Stratoscope 13y agoAh, that explains a lot. It certainly explains why the complaints didn't resonate with me. I know JavaScript very well, and there are things I don't like about it, but these weren't them. Or if they were, I've gotten used to them. I think I did miss the point with my previous comment. Maybe I was confused by the title: The article isn't "What's wrong with JavaScript", but as you said it's much more about things that will confuse Rubyists who arrive at JavaScript by way of CoffeeScript. For an article on that topic, it does make sense to have CoffeeScript examples. But it would be much better - and so easy - to include the matching JavaScript for each of the CoffeeScript files. Not only would it help JavaScript programmers understand the article, but it would show how CoffeeScript attempts to work around these issues. Even better would be to add matching examples of similar Ruby code. Code examples in all three languages would make for an interesting article: the Ruby way, the CoffeeScript way that makes JavaScript a bit more like Ruby, and the JavaScript way.
- k3n 13y agoJust because it's printed on the internet doesn't make it true.
- shtylman 13y agoJust because you say something doesn't make it true :)