Live data from Hacker News

We don't want your coffescript

blog.ponyfoo.com

31–40 of 51 posts

Re: We don't want your coffescript

#31
I don't understand the claim the the outputted Javascript is hard to read. Whenever I have a problem with Coffeescript, the first thing I do is look at the output, usually in the Chrome devtools. If it doesn't compile, I'll yoink the offending code out and feed it into the linter at coffeescript.org. It is by far the least odious part of my workflow.

Part of me wants to claim that if Coffeescript is getting in your way, you're trying to do too much. I consider it a code smell and start to wonder what needs to get refactored.

Re: We don't want your coffescript

#32
post #11
post #9

Earlier quoted context omitted.

I can read it but it's a struggle. Much like reading Ruby, for someone who comes from Python. The syntax doesn't quite make sense to me and its usage varies between authors—a bunch of things are optional and used unpredictably (parenthesis, lambdas, indent-alignment). Despite the Pythonish indent-based blocks, CoffeeScript is very much Ruby-like in syntax and culture. From my experience, fluent Ruby readers enjoy Cof…

I think making analogies about this is hard. Programmers are used to thinking about languages as Big Things that change the way you think. This is not that. I would encourage you to dedicate a block of about 30 minutes to port a single piece of non-trivial JavaScript code to CoffeeScript. You'll almost certainly neutralize any hangups you have in this short period.

The first time I tried to do this, it forever changed the way I write Javascript.

Re: We don't want your coffescript

#33

Earlier quoted context omitted.

Agreed completely. My only issue w/coffeescript is that, uh, I like clojurescript better. But clojurescript is all the things coffeescript is, just more ---further from javascript, more concise, less compatible with standard js tools.

coffee-script is not less compatible with standard js tools. Again, "it's just javascript" and you can use backticks in coffee to get embedded js. Common mistake made by coffee-script-nay-sayers.

Give me a break, you know what I mean. When you look at the page source, do you see embedded coffeescript? Can you debug in coffeescript with the standard tools?

I know these things aren't possible and shouldn't be expected b/c coffee is a "compiled" language...but you can do them in javascript, and telling the vanilla js programmer that they're "exactly the same" is being less than honest.

Re: We don't want your coffescript

#34
I'm happy to go head to head with this link baiter on who knows Javascript better :). I'm not going to take "you might even learn something about Javascript" from someone who says that a simple transpiler is a "black-box" that's totally beyond them.

p.s and a link-baiter than has a loading screen on their blog that crashes Chrome on iOS

Re: We don't want your coffescript

#35
Is there a mass CoffeeScript-answers-to-JS-Questions taking place on SO? Without even pointing to some instances of CoffeeScript-ers arrogance/mischief, ranting like that is not a nice thing to do.

Re: We don't want your coffescript

#36
post #9

Earlier quoted context omitted.

I can read it but it's a struggle. Much like reading Ruby, for someone who comes from Python. The syntax doesn't quite make sense to me and its usage varies between authors—a bunch of things are optional and used unpredictably (parenthesis, lambdas, indent-alignment). Despite the Pythonish indent-based blocks, CoffeeScript is very much Ruby-like in syntax and culture. From my experience, fluent Ruby readers enjoy Cof…

Strange. I know Ruby and Python and switch between them quite frequently, but generally prefer Ruby. I loathe CoffeeScript. My problem with CoffeeScript is it imposes extra burden—to learn the syntax, and to learn how the build tools and process works (which, once you factor into account the various different web frameworks like Rails, Django, Flask and whatever brand of crazy syrup the Node people are currently drin…

I second that. I wouldn't hire any developer delivering just CS, because it shows a "just wanting getting stuff done" attitude, as opposed to some commitment to the language used and its inner workings.

Example: Maybe the most beloved feature: anonymous functions

CS: (x) -> x + x

It's like "yeah, I want to get this block done here", and it obfuscates the workings of the language (e.g.: this is a function with all its inheritance and a shared scope, it returns a reference, which can be used as any reference and is interchangeable with a reference to a named function, etc – the construct essentially obfuscates that the expression is returning an object of type "Function").

I don't think that anyone would get away with it in a C-development position, who would be delivering a source for a precompiler using a construct like, say

loop(i as a replacement for

for (i = 0; i IMHO, this is a very JS-specific phenomenon. And it's a bit strange, having something like a lingua franca nobody seems to care about.

(Edit: Sticking to the lingua franca issue: It's a bit like having Latin as a lingua franca in the middle ages and some community using "Habs papa" for "Habemus papam". Even if "habs" compiles to "habemus" and the forth case of "papa" is easily inferred by the context, it fails the whole issue of using a lingua franca.)

Re: We don't want your coffescript

#37
post #30

What i've never understood about coffeescript is, since it compiles to javascript, why not just learn to write javascript in the idioms that coffeescript generates? No one would have a problem suggesting that a developer who only used jQuery actually learn how to code in standard js without the syntactic sugar. CS doesn't compile to bytecode, it compiles to an actual, human-readable and editable language. So why not…

Abstracting away the messiness of classes in JS is justification enough for CS, IMHO.

Also, to use your above example, I agree understanding that style of JS is important, but that doesn't mean you shouldn't use the tool.

Re: We don't want your coffescript

#38
post #18

Earlier quoted context omitted.

Strange. I know Ruby and Python and switch between them quite frequently, but generally prefer Ruby. I loathe CoffeeScript. My problem with CoffeeScript is it imposes extra burden—to learn the syntax, and to learn how the build tools and process works (which, once you factor into account the various different web frameworks like Rails, Django, Flask and whatever brand of crazy syrup the Node people are currently drin…

> does nothing to address the things that I hate about writing JavaScript (oh, the weakly-typed type system for one thing It can't because it's actually JS, by design. Yet it dutifully tries as hard as it can within this design goal by e.g making its == compile to JS ===. Maybe you'd rather be interested in ClojureScript or Dart, which use JS merely as a VM instead of their systemic core. > If a front-ender on my tea…

> Yet it dutifully tries as hard as it can within this design goal by e.g making its == compile to JS ===.

Now we're effectively losing the "==" operator, which is behaving like in most other traditional scripting languages (e.g. Perl). What did we win by losing an operator? Why obfuscate that this is not the JS "==" operator but most likely the "===" operator?

Re: We don't want your coffescript

#39
post #29

You need to get more benefit from the abstraction than the cost. I couldn't find it, in cs. I've made thousands of mistakes (on a daily basis it feels like). In 17 years I don't think I have ever once forgotten to put 'var' in front of a variable declaration.

its not about if you make the mistakes or not per se, its about the removal of unnecessary mental burdens.

Re: We don't want your coffescript

#40
post #14
post #4

Are there people that seriously can't just read CoffeeScript as-is? Are there seriously people that can't scan through the CoffeeScript docs in about 20 minutes and pick up the language more or less? The first time I saw CoffeeScript I immediately realized, oh, fuck yes, this is obviously better, and switched over to it immediately. I was productive with it instantly. Is it really something worth spending your time a…

> The first time I saw CoffeeScript I immediately realized, oh, fuck yes, this is obviously better, and switched over to it immediately. I was productive with it instantly. Which is fine for you. But I tried it for a project then ditched it, because it didn't justify the extra tooling required in my development pipeline, and because there are ambiguities and inconsistencies in the syntax and the language, and yes, oc…

I don't mean to sound dense, but who isn't using some kind of build system these days with their JavaScript? "Extra Tooling" really is quite trivial given the general de-facto standards that are now in place.

As far as the ambiguities and inconsistencies go, that I can understand.

Post reply on HN