function({}) ? - I'm guessing you mean function() {}.
and why write:
var that = this
when you can bind a function?
I actually think javascript is a beautiful language and coffeescript is uglier. Javascript has less symbols to learn (no @ for this and no -> or =>). Also you know that parenthesis and semi colons are required (or at least you have it in a style guide that they are). In coffeescript people can just drop parenthesis which makes things harder to read. I like having a parenthesis rather than whitepaces as I can scane for them to know a function is starting. That's what I call beautiful, the ability to know you're looking for one thing, not one of several.
I don't think beauty or readability is a case for coffeescript, if you're making a case then talk about the good things it does bring (you mentioned not putting in var which I like) but also comprehensions, splats , the existential operator and string interpolation.
This. I've earnestly been trying to find someone who could finally sway me to the side of CoffeeScript because with all the rabble, it feels like I must be missing out on something. But everyone always talks about the "beauty" of it but I, like yourself, find JS syntax to be much nicer and more readable.
Sure, JS is more verbose and the little gotcha's can be a pain in the ass but when you're reading JavaScript you know you're reading JavaScript. Provided the person who was writing it kept their code formatted well, you can just scan through the code and see where variables are set, functions are defined, and all that other jazz. And while the gotcha's can be a pain, I think they add a little bit of character ;)
I've earnestly been trying to find someone who could finally sway me to the side of CoffeeScript because with all the rabble, it feels like I must be missing out on something.
Let me counter that statement with the following: I've never met anyone who has written a meaningful amount of Coffeescript and gone back and said they prefer Javascript or that Coffeescript doesn't have value.
I was once like all of you. I didn't see what all the hubbub was about and, frankly, I thought it was stupid that someone would go through the trouble to learn a new language which compiles to Javascript instead of just writing Javascript.
But then I joined a company which uses Coffee and now I'll never go back.
Meet me. I've written numerous projects with coffee, both clientside and node. Coffee feels rigid, especially while working within its class structure. Imagine my surprise when every method and prop has to be public. No thanks. I'll make a gross over generalization like you - every dev I've met who jizzes over coffeescript has been super lazy.
"CoffeeScript is just JavaScript" so your issues with private props/methods are no different than they are in vanilla JS. To write quality CoffeeScript requires a very good understanding of how JS works. Understanding its functional programming abilities requires a subset of knowledge that most JS devs don't encounter. It's not laziness, it's efficiency.
22
u/rhysbrettbowen Nov 16 '12
A couple of things, when would you ever write:
function({}) ? - I'm guessing you mean function() {}.
and why write:
var that = this
when you can bind a function?
I actually think javascript is a beautiful language and coffeescript is uglier. Javascript has less symbols to learn (no @ for this and no -> or =>). Also you know that parenthesis and semi colons are required (or at least you have it in a style guide that they are). In coffeescript people can just drop parenthesis which makes things harder to read. I like having a parenthesis rather than whitepaces as I can scane for them to know a function is starting. That's what I call beautiful, the ability to know you're looking for one thing, not one of several.
I don't think beauty or readability is a case for coffeescript, if you're making a case then talk about the good things it does bring (you mentioned not putting in var which I like) but also comprehensions, splats , the existential operator and string interpolation.