Live data from Hacker News

Announcing CoffeeScript 2

coffeescript.org

201–210 of 220 posts

Re: Announcing CoffeeScript 2

#201
post #148

Earlier quoted context omitted.

I loved CoffeeScript, but I felt it was a double edged sword. I would still use it though, if there were JSX style xml/html tags. But React changed everything for me and as a full stack dev, I can use only few frameworks on one level. Edit: Ok, JSX is now supported. http://coffeescript.org/v2/#jsx And I'm glad they broke the different behaviour of =>. It might need a fix in a lot of code bases, but this price is chea…

I personally can't stand jsx, and coffeescript makes it so much nicer to avoid when using React. It's almost like haml / slim / jade / pug if you know what I mean. I wrote a comparison about it a couple years ago: http://rapin.com/blog/2015/02/03/reactjs-with-coffeescript/ I'm not doing much react these days ( cough elm), but I think it's still mostly relevant.

Elm... And not to forget PureScript... and to a lesser extend ReasonML (by which you can still use React and JSX)... and Haskell/GHCJS. There are quite a lot of ways to seek refuge from both type scarcity and the "semicolon" line noise that was mentioned.

Here some benchmarks for several of the FWs that are popular in these languages (Elm has the FW built-in, ReasonML-React is missing but should be close to React.js).

https://medium.com/@saurabhnanda/benchmarks-fp-languages-lib...

Re: Announcing CoffeeScript 2

#202

Earlier quoted context omitted.

I loved CoffeeScript, but I felt it was a double edged sword. I would still use it though, if there were JSX style xml/html tags. But React changed everything for me and as a full stack dev, I can use only few frameworks on one level. Edit: Ok, JSX is now supported. http://coffeescript.org/v2/#jsx And I'm glad they broke the different behaviour of =>. It might need a fix in a lot of code bases, but this price is chea…

I'm not a big fan of the new =>, it means the arguments variable will have parent scope in => but not in ->, it kind of erodes into coffeescript's elegance/consistency imho, unless I'm missing something ?

You can always add an splat to use instead of arguments:

    (args...) =>

Re: Announcing CoffeeScript 2

#203
post #177
post #10

I can't imagine CoffeeScript will see much adoption these days as most people seem to think ES6+ is "good enough". I miss how concise functions are in CoffeeScript and also miss being able to do object literals without the braces. But there's no chance at all in convincing my team to adopt it, as modern JS really is "good enough".

I don't miss how "concise" it is. Concise syntax usually means "fun to write, hell to read". It's not that ES6 is good enough; it's that CoffeeScript is actually "bad".

I find idiomatic CS easier to read than idiomatic JS. Matter of taste.

Re: Announcing CoffeeScript 2

#204

Earlier quoted context omitted.

I love Python, but I always found CoffeeScript took Python's stylistic choices too far. Making {} around object literals and () after function calls optional led to code that was very difficult to visually parse.

My friend that is using cs every day now was also using () around every function call back in the day. Now he doesn't. I think it is more of a preference that _changes_ over time. Just saying that you might like it the other way one day

Maybe. I only used CS for one project, after years of primarily programming Python. I could also believe that, if applied judiciously, the characters could be dropped without harming clarity.

However, the codebase I was working in had no clear style guidelines about when it was acceptable to drop braces/parens and so it left me wanting for Python's "there's one way to do it" aesthetic.

Re: Announcing CoffeeScript 2

#205

Earlier quoted context omitted.

My friend that is using cs every day now was also using () around every function call back in the day. Now he doesn't. I think it is more of a preference that _changes_ over time. Just saying that you might like it the other way one day

Maybe. I only used CS for one project, after years of primarily programming Python. I could also believe that, if applied judiciously, the characters could be dropped without harming clarity. However, the codebase I was working in had no clear style guidelines about when it was acceptable to drop braces/parens and so it left me wanting for Python's "there's one way to do it" aesthetic.

I agree. It is not advised to introduce confusing syntax if there is a chance that somebody outside of the group would use the code.

It is even more frustrating in .js repositories today. People use various ESXX flavours and syntaxes that might not compatible with each other.

Just look at this list: https://babeljs.io/docs/plugins/ My favorite is: babel-plugin-transform-decorators-legacy (A plugin for Babel 6 that (mostly) replicates the old decorator behavior from Babel 5)

Talk about code reuse

Re: Announcing CoffeeScript 2

#206
post #202

Earlier quoted context omitted.

I'm not a big fan of the new =>, it means the arguments variable will have parent scope in => but not in ->, it kind of erodes into coffeescript's elegance/consistency imho, unless I'm missing something ?

You can always add an splat to use instead of arguments: (args...) =>

Sure, but there used to be a strong performance advantage when using the arguments variable with function.apply, also editing arguments' values affected named parameters' values (not sure that's desirable, but you know, semantics)

Re: Announcing CoffeeScript 2

#207
post #20

Earlier quoted context omitted.

I was browsing the CoffeeScript docs and everything looks much more concise. It seems like your code would half the size. Have people done real world comparisons on large code bases? Rewrites?

We did. And had to "decaffeinate" everything a few months later because it is hell to work with implicit returns, objects without brackets, no spread operator, significant whitespace, no variable declaration keyword... It really is a matter of taste, but the large majority of us didn't like it. It is pretty, but I felt like fighting against the language all the time (implicitly returning an bracketless object is not…

Yes, CoffeeScript is chaos. I've found that CS's biggest proponents can be heard to say "Let's just replace it with a custom thing I'll build this weekend" much more frequently than normal. Surely this is coincidental. ;)

The old joke was that Perl is a write-only language, and CoffeeScript et al are essentially thought experiments for how deep into the write-only abyss people are willing to plunge as a non-joke. It's no mystery that CS primarily attracts people who heavily discount the importance of long-term maintainability.

The core issue seems to be that some people have conflated prescience with elegance. We must stop deluding ourselves into pretending there are languages that can read our minds. Put your intent in the code, avoid ambiguity. If the answer is not obvious and consistent, do not rely on either the computer or the human to extract your intent from the ether.

Re: Announcing CoffeeScript 2

#208
post #67

Earlier quoted context omitted.

actually I don't think it so uncommon. when you travel you meet a lot of people who just quit and can prop. go back to the job when / if they return. just do it.

This isn't recommended. If you quit the company, that shows you obviously do not want to work for them. If you quit once, what's the likelihood you'll quit again? And how soon? Why waste everyone's time? You'll need to make a seriously good case as to why the company should rehire you. In Jeremy's case, he wrote a lot of code that a lot of people use around the globe. That adds a lot of value to him. Luckily, for him…

>Some other companies aren't so nice.

Just ask! And if it's not ok, do it anyway and then get another job. Maybe this is more common over here in europe but basically everybody who really wants to travel does it like this.

On my travels (mostly most of asia, south and middle america, some europe) I have met nurses, doctors, military doctors, journalists, devs (a lot), sound engineer, hair stylists, bankers (he was hilarious), DJs, salespeople, night watchman, ....

Travelling the world gives you more experience, more insights and more perspective than just being another desk jockey like everybody else in the company.

Also never let your actions be determined by fear ("will not be hired again, will not be as valuable in the workforce if I travel for a year, ..."). if you want to travel, just do it. (and read books about stuff that really interests you while you do it.)

And: companies are usually not nice, but the people within companies are most of the time pretty decent, and they usually like people which just do their thing.

Re: Announcing CoffeeScript 2

#209

Earlier quoted context omitted.

i really wanted to like coffeescript, but the idea of compiling, transpiling or any other kind of piling of javascript just rubbed me the wrong way. this is true of scss, less and other css flavors too. i understand the problems these tools are trying to solve, but i don't like that you have to learn two (or more) grammars and syntaxes, and the quirky interactions between them, to get those benefits (because you can'…

If you automate it and it's part of your deployment pipeline, you'd hardly notice it's there. We use both SCSS and CS via Rails and it's a breeze. The occasional times when I don't understand why something is not working I go to the coffeescript website and read the transpiled code and it's usually obvious what's going on.

yes, i have dependencies that use both scss and coffeescript, so it's part of the deployment pipeline. i just don't like using them much myself =P

Re: Announcing CoffeeScript 2

#210

Earlier quoted context omitted.

i really wanted to like coffeescript, but the idea of compiling, transpiling or any other kind of piling of javascript just rubbed me the wrong way. this is true of scss, less and other css flavors too. i understand the problems these tools are trying to solve, but i don't like that you have to learn two (or more) grammars and syntaxes, and the quirky interactions between them, to get those benefits (because you can'…

> it's a lot more cognitive overhead for what amounts to a little syntactic sugar. This isn't really accurate with respect to meta languages like SCSS that add new features not present in the underlying language, like variables. You really are missing out on a lot by not using the meta languages.

yes, variables are nice. hopefully the glacially slow integration of them into css proper (css custom properties) will arrive soon: https://developer.mozilla.org/en-US/docs/Web/CSS/--*
Post reply on HN