Live data from Hacker News

Announcing CoffeeScript 2

coffeescript.org

51–60 of 220 posts

Re: Announcing CoffeeScript 2

#51
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…

> implicit returns

In my experience it has only been a problem when porting existing code bases. We only had to be a bit careful putting a return after a for loop at the end of a function so it doesn't build a list unnecessarily (otherwise implicit returns of unused random values don't hurt). For clarity, one of the few rules we have is to use return explicitly when a function is more than a single expression.

> objects without brackets

The language allows it but it doesn't mean you must use them. We have a loose style guide where we forbid a few confusing uses (like bracket-less one liners or returned objects). So loose it's shorter than this comment.

> no spread operator

It always had a spread operator (except for the first month of life). It's just called splat instead of spread, like in Python. Now it also allows ES6 syntax which is very similar (...foo vs. foo...).

> significant whitespace

That's not a bug, it's a feature ;)

> no variable declaration keyword

In the last year or two, that only bite us once. If it's more frequent than that your functions are way too long.

But as you say, it's a matter of taste.

Re: Announcing CoffeeScript 2

#52

Jeremy, First off thank you for Underscore, Backbone and CoffeeScript. Your work really has helped me and my development team. This question is a little off topic but one I've been wanting to ask for a long time: Last year you took a year off from The New York Times to ride your motorcycle across the Western Hemisphere. Just recently you were hired back at the paper, doing what it appears to be the same thing in the…

Happy to answer, although this is a bit of a funny forum for it: From a work perspective, it's pretty simple. I quit, and then was rehired to the same position a year later. But The Times' Graphics Desk was super nice about it. We had a handshake agreement that I'd come back when I got back, and they even lent me a laptop to maybe file some travel-ish bits and bobs from along the road. So in that sense, it was partia…

> In the end I didn't end up writing anything for them

I understand that you didn't write anything professionally about your trip, but did you ever write anything casually about it - blog posts or the like? It sounds like it would make for interesting reading :)

Re: Announcing CoffeeScript 2

#53

Jeremy, First off thank you for Underscore, Backbone and CoffeeScript. Your work really has helped me and my development team. This question is a little off topic but one I've been wanting to ask for a long time: Last year you took a year off from The New York Times to ride your motorcycle across the Western Hemisphere. Just recently you were hired back at the paper, doing what it appears to be the same thing in the…

Happy to answer, although this is a bit of a funny forum for it: From a work perspective, it's pretty simple. I quit, and then was rehired to the same position a year later. But The Times' Graphics Desk was super nice about it. We had a handshake agreement that I'd come back when I got back, and they even lent me a laptop to maybe file some travel-ish bits and bobs from along the road. So in that sense, it was partia…

I admit it is a funny forum to ask this, but, hey, here we are.

Thanks for the response. It seems your situation was unique, and you're definitely fortunate to have a department willing to make this agreement.

The Average Joe more than likely can't pull this off, especially if the company can hire a replacement.

Re: Announcing CoffeeScript 2

#54
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".

This is true (few adopting coffeescript), but CoffeeScript influenced much of todays ES6+, so it still lives on :)

Re: Announcing CoffeeScript 2

#57
post #24

Earlier quoted context omitted.

And that's totally fine! I don't get a chance to use it much these days either. But for the folks who still do — or have existing codebases — this update is for you.

Hey, I'm working on a template language that compiles into Redux + IncrementalDOM. Part of it involves a pipeline syntax similar to underscore or lodash. I'm wondering what you would consider a modern equivalent of those two libraries using native methods, iterators, etc. or if vanillajs is sufficient now. If anyone wants to take a look it's at tmzt.github.io/isymtope and github.com/tmzt/isymtope The #cleanup-symbols…

Very intriguing! I'm a Redux maintainer - please feel free to ping me if you've got any questions on the Redux side of things.

Re: Announcing CoffeeScript 2

#59
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".

And that's totally fine! I don't get a chance to use it much these days either. But for the folks who still do — or have existing codebases — this update is for you.

I still use CS every day on multiple projects. IMAO CS is one of the best non-typed languages out there. It's really sad that so many modern/babel JS proponents fail to see the beauty of it.

I hope that this release (and hopefully future releases) will help to keep CS alive. Thanks to all contributors!

Re: Announcing CoffeeScript 2

#60
post #42

Earlier quoted context omitted.

Happy to answer, although this is a bit of a funny forum for it: From a work perspective, it's pretty simple. I quit, and then was rehired to the same position a year later. But The Times' Graphics Desk was super nice about it. We had a handshake agreement that I'd come back when I got back, and they even lent me a laptop to maybe file some travel-ish bits and bobs from along the road. So in that sense, it was partia…

> booze, bribes, women Kind of curious about the "bribes" part...

Nothing too spectacular, I've got enough Spanish to talk through all of the border crossing paperwork comprehensively, which helps avoid problems with papers down the line.

You have to get a temporary import/export permit and country-specific insurance every time you cross a border. I ended up crossing 33, so that's plenty of paperwork to potentially get fouled up on. And in some countries checkpoint cops love busting gringos for their paperwork, because if they're missing something mandatory, that's easy money.

I screwed up the US/Mexico border first by not having done my research. Crossing from Presidio to Ojinaga, I made sure to get Mexican insurance, but didn't think to set Banamex bond for the temporary import permit — not required in the border zone, so the customs officials don't mention it. I didn't have it, and if any official in the length of Mexico had asked me for my paperwork (despite passing multiple checkpoints), that would have been full legal grounds to seize the bike. But I made it to the Guatemalan border trouble-free, and the customs exit officer nailed me for it there. "It's easier if you just pay me the fine." Around $50, I think. I got change from his wallet.

The second not doing my research screwup was not bringing my original title document to the motorcycle with me, just some color photocopies. In most cases, copies are fine — after all, we don't drive around with our titles in our glove boxes. But leaving El Salvador, at the Honduras border, a cop in front of the immigration building decided to make an issue of it. "I'm sorry, but without the original title document, there's nothing that can be done." After about half an hour, with some help from a roadside border-crossing fixer (there are many on the El Salvador / Honduras border, because these situations are notorious there) and a little over $200, the bike and I were through.

Of course, the first thing I did after arriving in Choluteca, Honduras, was to head over to the police station and file a false report, saying that I had left the original title in the top bag of the motorcycle and someone had stolen it, along with a few other miscellaneous documents. When getting yourself out of paperwork trouble, an officially stamped police report is as good as gold. From that point on, at any border where the photocopied title wasn't good enough (Peru, in particular, gave me a really hard time about it), I could show them the police report, show them that the VIN on the report matched the VIN on the photocopied title matched the VIN on the bike, and we were good to go.

Like I said, not NYT-standards behavior.

Post reply on HN