8 ms·
I've looked into CoffeeScript, and while I really like the sentiment—routing around JavaScript's warts—I fundamentally disagree with the technique employed to a
by edw 15y ago
I've looked into CoffeeScript, and while I really like the sentiment—routing around JavaScript's warts—I fundamentally disagree with the technique employed to achieve the goal.
What the world needs is less syntax, not more. Perl, Ruby, and Haskell—the inspirations for CoffeeScript, as near as I can tell—are, as a recently-linked entry called Perl, programming languages that you have to constantly use to keep your programming skills.
For all its problems, as long as you can remember to use === and friends instead of ==, JavaScript's syntax is relatively obvious, if unweildly, to anyone who grew up in a C dominated world.
Fargo, the recently-linked Scheme in JavaScript, is something I an get behind personally, though sadly Clojure is becoming the default Lisp my mind thinks in.
We need to declare a moratorium on new syntax. With Lisp, C, Python, and a couple other languages (maybe), we have all the syntax we need. Novelty is not innovation. New is not better.
We live in a world where utility players, i.e. everyone in a startup, already have to think in terms of too many different languages.
- stdbrouw 15y agoEhm, I've been programming in Python for quite a few years now, and CoffeeScript syntax is pretty much Python with a smattering of Ruby (or the other way around), and some niceties like using the question mark for safe navigation or having "yes" as an alias to "true". That hardly makes for a sigil overdose. What exactly is tripping you up?
- Cushman 15y agoWe all agree that some syntaxes are better than others. So you're willing to settle for JavaScript; that's cool, CoffeeScript is 100% compatible. (More than, if you consider that even bad CS compiles to good JS.) But complaining about novelty reeks of telling us kids to get off your lawn. Some syntaxes are better than others. We haven't found the best one. Innovation is still possible. Hackers innovate. Get used to it.
- thesz 15y agoYour comment finally made me to acquaint myself with the precise meaning of word "innovation". http://en.wikipedia.org/wiki/Innovation http://en.wikipedia.org/wiki/Innovation I think that hackers invent, not innovate. Innovation is too risky to be taken by one or even little group. It is something between an act of changing values (or axioms) of system and the process of that system change. I also think that innovation is too pompous term in the discussion of programming languages syntax. http://en.wikipedia.org/wiki/Invention http://en.wikipedia.org/wiki/Invention Invention is much lesser term and much more nimble. And it could provoke innovation, of course. But for innovation we need semantics more than syntax, I think.
- yesbabyyes 15y agoI guess you have had some experience that explains this sentiment of yours, even though I can't guess at what it is. To me, CoffeeScript is pretty much to Python as Clojure is to Common Lisp, as far as syntax is concerned. It's similar enough for syntax not tripping anybody up. One of the problems with JavaScript's C-like syntax, IMO, is that it makes people think in a C-like way. CoffeeScript's syntax brings out the functional qualities of JavaScript in a nice way. Writing CoffeeScript makes me a better JavaScript programmer. Further, if you're working on a Node stack there are a few levels where CoffeeScript and JavaScript can interact. Different modules can be written in either language. You can expose a http.Server interface in your application. If you're on Connect/Express, you can mount routes to apps written in either language, or even Zappa. And if you want a moratorium on new syntax, I suggest you stop learning new syntax. I look forward to a future where syntax moves further into the background.
- edw 15y agoMy experience stems from learning the language of the week for twenty years until getting serious about learning lisp, and coming to see that syntactic innovation at the language parser level is a waste of time. Syntactic innovation should occur through a macro facility that gives everyone, not just the parser-writing language gods, tools to build a language that suits their needs. That is why CoffeeScript is ultimately uninteresting if perhaps useful to people who don't understand or are not in a position to use lisp. In my experience, JavaScript's syntax has never encouraged people to think in a C-like way. In a Java-like way, perhaps, but not really even then. People seem to get, if they're remotely clueful, that JavaScript programming calls for a lispy approach. It's all the damn parens and (optional) semicolons and braces and no-win indenting scenarios that frustrate people who try to exploit JavaScript to its fullest. Yes, CoffeeScript solves these problems and others, but through the introduction, as I said before, of yet a new set of rules that result in whitespace-sensitive line noise code that requires frequent contact to stay familiar with. And again, I'm a busy person: a new language wastes my time because I already need to write shell scripts, Clojure, and Python in a daily basis. I know JavaScript, even if I dislike it. And if you're going to learn a language that doesn't help your resume with The Man, you may as well learn a language that can change your life. Like a lisp.