News for hackers. Stuff that matters.
Re:JavaScript is not suitable for large web apps by jwoah12 on Thursday June 14, 2012 @05:28PM (#4113594)
As I read more of these arguments, it makes me think a lot about whether I should switch to CoffeeScript before my web app gets any larger. Has anyone switched to CS or another language that compiles to JS, and regretted it?
Re:JavaScript is not suitable for large web apps by joshontheweb on Thursday June 14, 2012 @05:45PM (#4113677)
I haven't switched to coffeescript but I have worked on several coffeescript codebases. Its not the end of the world, but I don't prefer it. It is an unnecessary level of abstraction and is fragmenting js. It also seems the coffeescript users tend to use haml and sass as well. When I am working on those projects I feel like I am drowning in preprocessors and frequently encounter cryptic errors as a result.
Re:JavaScript is not suitable for large web apps by drivingmenuts on Thursday June 14, 2012 @10:25PM (#4114639)
I can't speak for haml, but sass is certainly a welcome tool in dealing with CSS, since it mostly uses CSS syntax, with sensible nesting to keep things orderly. sass takes what you already know and kicks it up one notch (perhaps two, if you want to use variables).
Re:JavaScript is not suitable for large web apps by zkirill on Thursday June 14, 2012 @05:38PM (#4113643)
Overall, CoffeeScript has made JS development much more enjoyable for me. We had also integrated the compiler very nicely into our build script.

This resource has been invaluable: http://js2coffee.org/

Re:JavaScript is not suitable for large web apps by pjungwir on Thursday June 14, 2012 @06:20PM (#4113818)
I've used Coffeescript on a couple large Rails projects, and I'd rather stick with Javascript. I haven't encountered any terrible debugging hurdles, but it just seems like obfuscation. And unlike one of your other respondents, I love Sass and Haml. I have nothing against preprocessing per se, but I haven't yet figured out what value CS adds. I appreciate easier iteration, but that's about it. But considering how many people rave about it, I'm willing to learn....
Re:JavaScript is not suitable for large web apps by hellopat on Thursday June 14, 2012 @05:39PM (#4113647)
I haven't used coffee script myself, but I think you'd be hard pressed to find someone that wrote something in CoffeeScript and regretted it. The biggest arguments against using CoffeeScript (or any language that compiles to JavaScript) that I seem to keep hearing are:

1. JavaScript isn't a very readable language. (I think this is untrue. I've seen some incredibly well written / structured JS) 2. Not everyone knows CoffeeScript, so when you put a project up on GitHub and it's written in CoffeeScript, it's difficult for people who only know the syntax of native JS to understand what's going on. (To counter this - a lot of projects that are written in CoffeeScript are bundled with the compiled JS code as well - which also happens to be very readable IMHO).

Re:JavaScript is not suitable for large web apps by pooriaazimi on Thursday June 14, 2012 @06:47PM (#4113940)
3. (biggest problem IMO): debugging in CS sucks right now. It would be a no-problem with SourceMap though, so we have to endure it just a few more months.
Re:JavaScript is not suitable for large web apps by cnp on Thursday June 14, 2012 @07:23PM (#4114098)
I hear this a lot, but seriously, have you ever had any real problems with debugging CS? The output is clear enough for anyone to know exactly where to go for the error.
Re:JavaScript is not suitable for large web apps by pooriaazimi on Thursday June 14, 2012 @07:37PM (#4114150)
It's a pain, still. I don't generate js files. When something like that happens, I have to go back to command-line, type 'coffee ...coffee', open generated js file and see where the problem was.
Re:JavaScript is not suitable for large web apps by jashkenas on Thursday June 14, 2012 @08:50PM (#4114385)
That's your problem right there ;) When you're using CoffeeScript, you're absolutely supposed to generate all of your JS files. -- For the same reason why you don't run all of your JavaScript via eval() while you're developing.

Try using `coffee --watch` instead.

Re:JavaScript is not suitable for large web apps by pooriaazimi on Friday June 15, 2012 @09:41AM (#4116412)
OK then. I have already 7-8 tabs in my terminal open all the time (a few for servers, some for redis, some for mongod, some for vi, some for other tools, some for debugging, etc.), so I guess another tab wouldn't hurt (I'm not a fan of running processes in the background).
Re:JavaScript is not suitable for large web apps by Androsynth on Thursday June 14, 2012 @05:45PM (#4113674)
doubtful. As a JS dev, I often find myself in situations where I wish I was working with CS instead.

However, this article isnt advocating CoffeeScript (well it is, but it doesnt actually make a case for it), its advocating using a statically typed language. CS gives you classes, but thats not a big deal (module pattern makes it trivial to implement classes in JS).

To scale your web app, the author is advocating writing your apps in Java, C# and actionscript.

Now that I think of it, this is a really poorly laid out argument. It spends most of the time arguing for static typing, then throws in CoffeeScript as a sop to the people who will flame him for advocating Java/C#/AS.

Re:JavaScript is not suitable for large web apps by lucisferre on Thursday June 14, 2012 @06:22PM (#4113839)
This article doesn't really look like it's worth my time to read in depth so I won't comment on it directly. But as far as javascript goes Coffeescript makes a lot of the idiosyncracy of javascript that create constant cognitive friction go away. I personally can't find any good reasons to not use coffeescript.
Re:JavaScript is not suitable for large web apps by coenhyde on Thursday June 14, 2012 @06:23PM (#4113842)
I switched to CoffeeScript and continue to use it for 90% of my projects. CS shines in the application domain, but don't use it when writing modules or a complicated application where you'll be debugging lots of logic errors.
Re:JavaScript is not suitable for large web apps by pooriaazimi on Thursday June 14, 2012 @06:46PM (#4113932)
I don't know what this article is about (looks like it's not worth reading), but I've switched to CS (IcedCoffeeScript, to be precise) for my Node.js app (a behemoth of an app!), and am much much happier. Sure, it has problems too, but they are more tolerable than having to do (if typeof(x)=='function' && x!=null) over and over again IMO, and the vast majority of them will be gone when we have SourceMaps (which shouldn't take long, maybe a couple more months).
Re:JavaScript is not suitable for large web apps by allardschip on Thursday June 14, 2012 @05:33PM (#4113612)
I switched to Coffeescript and rarely if ever look back...
Re:JavaScript is not suitable for large web apps by mistercow on Thursday June 14, 2012 @05:34PM (#4113615)
It's hard to imagine having much regret about a switch to CS since it would be so easy to convert your code back to JS if you ever needed to (and since you could do so incrementally).
Re:JavaScript is not suitable for large web apps by heretohelp on Thursday June 14, 2012 @06:03PM (#4113761)
CoffeeScript is a syntax, not a language.

His arguments have to do with the semantics of JavaScript, which are identical to the semantics of CoffeeScript.

Re:JavaScript is not suitable for large web apps by prodigal_erik on Friday June 15, 2012 @02:18AM (#4115295)
Coffeescript has a very similar object model, but it does alter (fix) the semantics of variable binding and expression statements and some unusably broken operators, and those involve treating Javascript more like a compilation target than an equivalent dialect.
Re:JavaScript is not suitable for large web apps by heretohelp on Saturday June 16, 2012 @04:28AM (#4120150)
Yesss running s/==/===/g...very semantically different ;)
Re:JavaScript is not suitable for large web apps by GnarlinBrando on Friday June 15, 2012 @02:34AM (#4115340)
Personally I think its great because it is just a different syntax for the same semantics.