Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I feel like the .js suffix is meant to imply this is JavaScript code, but it is actually CoffeeScript. They are not the same.

Why is it not named Smooth.coffee?



Because it compiles to js and can run in either.


There's no such thing as "running CoffeeScript".

> The golden rule of CoffeeScript is: "It's just JavaScript".


You can always run coffee at the command line.


I considered naming it that, but ultimately decided that the fact that it's written in CoffeeScript is irrelevant. It's a JavaScript library; it's meant to be used with JavaScript (which of course implies that it's meant to be used with CoffeeScript), but it happens to be written in CoffeeScript.

And there is every possibility that it could get rewritten in JavaScript. Or it could be rewritten in something else that compiles to JS, if something comes along to which this task is well-suited. The implementation can change, and the name should remain appropriate. What will not certainly change, however, is the environment in which this is intended to be used.

Hope that makes sense.


I guess so. I wouldn't mind if it was smooth.coffee (maybe other people would?), but I can see your rationale.

It seems like saying something could be cross-compiled doesn't really mean it is in that other language, but again, people seem to think of CoffeeScript as different.

Also, sorry for forgetting, but thanks for making this! It looks pretty awesome.

Do you have any plans for extrapolation?


My first thought was "Awww, it's in CoffeeScript" :) It looks like there in fact is an issue with how people (at least me ;) ) react to CoffeeScript... I wonder if you have real control over the performance. Anyway - it's a great idea and I think the name is appropriate.

BTW. Yesterday I needed to mirror some sequence and I ended up using Math.sin()


> I wonder if you have real control over the performance.

In general, the mapping between CoffeeScript and JS is so trivial that it's hard to think of places where there could be a lack of control. Of course, if that were ever an issue, CoffeeScript lets you directly embed JS by surrounding it in backticks.

I also had a bad gut reaction to CoffeeScript initially, and I won't pretend it doesn't have drawbacks; the powerful, in-browser debugger that it desperately craves still hasn't yet been written, after all. But it really gets right what so many compile-to-javascript languages have gotten wrong in the past. At the very least, it is hands down the easiest way to sketch an idea for JavaScript. I just never end up feeling like I would gain anything significant by porting that sketch to native JS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: