Hacker News new | ask | show | jobs
by geuis 5175 days ago
I just finished a contract at a company of very smart engineers who decided to use Coffeescript way before I got there.

The guys that I was working with were way more brilliant than I am. Guys that have machine learning books on their desks for lunchtime and are doing some amazing work that is going to benefit hundreds of millions of people around the world.

To reference this quote from the article: "Any respectable CoffeeScript engineer should have a strong knowledge of JavaScript".

That, frankly, is not true.

One of the reasons I was brought on was to work on some javascript-heavy stuff. I was a newbie to coffeescript beforehand, so to hit deadlines wrote everything in vanilla js to save time and get work done. The guys on the team are very smart, but not really on top of the javascript game. So in this case, coffeescript was definitely being used because it was easier for them as traditional programmers.

Earlier this week, I spent a couple days and finally went through and ported everything over to CS.

In my experience of having manually written a complicated client-side app in js, then manually ported it to coffeescript, I really just don't like CS.

I'm used to Python. Indentation there is natural. Its idiomatic to what Python is. But its not in javascript. Granted, indentation should always be used in js for readability, but brackets really are needed to denote code blocks.

Another complaint I have against CS is that it tries to do so much stuff "as if by magic" that I was never 100% what my code was going to output. I just find:

    abc (arg,arg2) ->
to be really fucking confusing. Not to mention adding in the fat arrow, or 'do' if you need to wrap something in a closure.

I'm probably old school, but when I write code I need to know explicitly what it will do. I know what 'this' will refer to based on how I write. Same for closures.

Lots of times, my original code was just as concise as the coffeescript version, and a hell of a lot more concise than what CS rendered out.

So everyone has their opinions, likes and dislikes. For me, I'm gonna stick with native javascript for the time being.

1 comments

> I'm used to Python. Indentation there is natural. Its idiomatic to what Python is. But its not in javascript. Granted, indentation should always be used in js for readability, but brackets really are needed to denote code blocks.

Why are brackets needed? Eliminating braces makes code easier to write and read (IMO) and I'd appreciate almost any indented language to follow suit where possible.

> I'm probably old school, but when I write code I need to know explicitly what it will do.

I've found this is mitigated by experience with CS. Just takes a small amount of time getting to know the language. Nowadays I have a pretty good idea of exactly what JS will be output when I'm writing CS.

> Lots of times, my original code was just as concise as the coffeescript version, and a hell of a lot more concise than what CS rendered out.

Concision in this case might be in the eye of the beholder. I find the outputted JS to be quite readable (the most important aspect) and I know what to look for and how to map it to my source code.

Would I recommend porting all of your existing JS to CS? Hell no! But I'd give CS another try for a new project and see if you like it. I think it would click if you used it to actually program toward an end rather than port existing JS. I can see the latter being frustrating, seeing how many different patterns there are for JS development.