CoffeeScript Is Just JavaScript

• 2 min read

For those of you unfamiliar with CoffeeScript, it is a language that compiles to JavaScript. There are both benefits and downsides to using CoffeeScript, but I’m not going to talk about those since everyone else on the Internet already has. There is only one point that I want to mention – and it’s an important one so pay attention.

It’s Just JavaScript

Most people I talk to who haven’t yet taken the time to learn CoffeeScript treat it like it’s a completely new language. I’ll often hear questions like “can I do X?”, or “does library Y work with CoffeeScript?” The answer to both of these is “Yes, It’s just JavaScript!” referencing scope, passing callbacks, using JQuery; It’s all the same, just written with different syntax.

So next time you find yourself asking if it’s possible to do something in CoffeeScript, first ask yourself “how would I do this in JavaScript?” If you can think of a way, you can do it in CoffeeScript. The only difference is that sometimes CoffeeScript has shortcuts to make things more concise, however there’s nothing preventing you from doing things the long way.

Parting Words

In summary, think of CoffeeScript not as a language, but a framework. Moving from JavaScript to CoffeeScript is like writing a web server from scratch, then switching to a web framework; You simply move from a lower level of abstraction to a higher one.

Understanding this point has helped convert me from a skeptic to a believer. I’m still not 100% convinced that CoffeeScript is the silver bullet, but the language features are really making it hard to go back to JS. We’ll see how I feel in a few more months though.

Be the first to cheers
Now look what you've done 🌋
Stop clicking and run for your life! 😱
Uh oh, I don't think the system can't handle it! 🔥
Stop it, you're too kind 😄
Thanks for the love! ❤️
Thanks, glad you enjoyed it! Care to share?
Hacker News Reddit

×

Recommended Posts ✍🏻

See All »
• 3 min read
✨ HTML Share Buttons
Read Post »
• 3 min read
🚅 Next Stop, Yaak
Read Post »
• 4 min read
💻 Wait for User to Stop Typing, in JavaScript
Read Post »