Live data from Hacker News

CoffeeScript: The beautiful way to write JavaScript

amix.dk

71–80 of 88 posts

Re: CoffeeScript: The beautiful way to write JavaScript

#71

I've done my fair share of web programming. But JavaScript (for me) has always been to add the flash, not to write the app. In the past couple of months, I dove into Backbone.js, Sammy.js, etc. and while my JavaScript worked, it wasn't "the JavaScript way". When I found CoffeeScript, I was very happy. But I've been moving back to more JavaScript recently because I've spent hours looking through the generated JavaScri…

If you can't debug in CoffeeScript, you can't take it seriously. Even meta-CSS frameworks suffer from this problem when there's errors you have to back-track through a whole layer.

Re: CoffeeScript: The beautiful way to write JavaScript

#72
post #56

Earlier quoted context omitted.

I agree with everything you are saying. Coffeescript really is for people who prefer a ruby/python syntax, and who just don't like javascript's syntax. BEATUY IS IN THE EYE OF THE BEHOLDER people! Just because you find javascript 'ugly' and coffeescript 'beautiful' doesn't actually mean everyone agrees with you. I think Javascript is beautiful and I've been coding it for 14 years. I have no need to replace the syntax…

Who said everyone has to agree? If you don't like coffee script, don't use it. It's that simple.

"CoffeeScript: The beautiful way to write JavaScript" is a fucking ridiculous thing to say. I'll counter that with Coffeescript is an ugly way to write javascript. Go ahead and say I'm wrong. Beauty is in the eye of the beholder, and I don't give a shit if I get downvotes, it's a ridiculous thing to post everywhere that javascript is somehow 'ugly' and coffeescript is somehow 'beautiful'. It's really quite retarded.

Re: CoffeeScript: The beautiful way to write JavaScript

#74
post #4

I can't shake the feeling that people that like CoffeeScript are those that don't "get" JavaScript (e.g. CoffeeScript's notion of a class, whereas JavaScript has none -- let go an embrace the prototypal object model). Further, most (if not all) of the examples of the problems with JavaScript are null and void. A language that combines paradigms? Most do. Sure, the name sucks, but that's hardly an issue. I understand…

I have to say that by using cs I learned a lot more about js. Maybe for old js cats it doesnt matter, but I only used js occasionally before, and now it became one of my favorite languages (I use with node, and I write all my node stuff in cs). One particular example that changed everything for me was the natural and simple way I could build the typical callback constructs with -> and => , so they almost look like bl…

I'm new to programming and learned a little bit of javascript lately. I'm going to do a mini project on Node just to give myself an excuse to learn more programming.

If you dont mind my asking, how would i go about using CoffeeScript with Node?

Re: CoffeeScript: The beautiful way to write JavaScript

#75

Earlier quoted context omitted.

I have to say that by using cs I learned a lot more about js. Maybe for old js cats it doesnt matter, but I only used js occasionally before, and now it became one of my favorite languages (I use with node, and I write all my node stuff in cs). One particular example that changed everything for me was the natural and simple way I could build the typical callback constructs with -> and => , so they almost look like bl…

I'm new to programming and learned a little bit of javascript lately. I'm going to do a mini project on Node just to give myself an excuse to learn more programming. If you dont mind my asking, how would i go about using CoffeeScript with Node?

If you build those simple 1-file-testservers with node, simply write them in coffee and then start them like "coffee myserver.coffee".

If it's more elaborated, you might want to set up some kind of build process and then use the generated js files. You could use a simple Makefile and compile your coffee files with coffee -c -b.

Re: CoffeeScript: The beautiful way to write JavaScript

#76

Earlier quoted context omitted.

Javascript is understood by most developers these days. CoffeeScript is pretty. (Edit: I don't think that "pretty" is a bad thing. I just... when is it the most important thing, or even high up on the priority list? Pretty isn't bad, but if it means learning an entirely new syntax and immature toolchain, its value for all but personal projects is unclear to me. I see that others value it differently, and I'm trying t…

You say "pretty" like it's a bad thing...

It's unusual usage as well. Like referring to a keyboard that lets me type faster or a screen that's more readable as 'pretty'.

Re: CoffeeScript: The beautiful way to write JavaScript

#77

Earlier quoted context omitted.

I'm new to programming and learned a little bit of javascript lately. I'm going to do a mini project on Node just to give myself an excuse to learn more programming. If you dont mind my asking, how would i go about using CoffeeScript with Node?

If you build those simple 1-file-testservers with node, simply write them in coffee and then start them like "coffee myserver.coffee". If it's more elaborated, you might want to set up some kind of build process and then use the generated js files. You could use a simple Makefile and compile your coffee files with coffee -c -b.

I'll try that. Thanks!

Re: CoffeeScript: The beautiful way to write JavaScript

#78

Earlier quoted context omitted.

I'm new to programming and learned a little bit of javascript lately. I'm going to do a mini project on Node just to give myself an excuse to learn more programming. If you dont mind my asking, how would i go about using CoffeeScript with Node?

If you build those simple 1-file-testservers with node, simply write them in coffee and then start them like "coffee myserver.coffee". If it's more elaborated, you might want to set up some kind of build process and then use the generated js files. You could use a simple Makefile and compile your coffee files with coffee -c -b.

Oh, i forgot: You can add the --watch switch and get your scripts compiled on save.

Re: CoffeeScript: The beautiful way to write JavaScript

#79
post #4

I can't shake the feeling that people that like CoffeeScript are those that don't "get" JavaScript (e.g. CoffeeScript's notion of a class, whereas JavaScript has none -- let go an embrace the prototypal object model). Further, most (if not all) of the examples of the problems with JavaScript are null and void. A language that combines paradigms? Most do. Sure, the name sucks, but that's hardly an issue. I understand…

I think the opposite: people you get CoffeeScript are more likely those who really get JavaScript. It's turning JavaScript into the language it was supposed to before before the marketers got their hands on it and "javafied it". In fact, Brendan Eich has taken a bunch of it's features and they will be included in the next version of JS (woot!): http://brendaneich.com/2011/01/harmony-of-my-dreams/ http://www.aminutewi…

Oh, rubbish. HOW has JS being "Javafied" by marketeers? If it WAS more Java like it probably would support classes directly and explicitly as Java does.

Re: CoffeeScript: The beautiful way to write JavaScript

#80
post #18

Earlier quoted context omitted.

In this case, the semantics were already decided: CoffeeScript was intended to map transparently to JavaScript. Each change to semantics would add complexity to that mapping.

Syntactic sugar is all CoffeeScript can ever be. Is pretty syntax better than common-use syntax? (To be clear: I don't have a strong opinion. I'm curious what the community thinks the value proposition for CoffeeScript, HAML, etc is.)

I think you've nailed it. I program a lot of JS. I don't especially like it. CS is trivially better because it is prettier but CS code expresses ideas in much the same way JS does. Big deal.
Post reply on HN