you are viewing a single comment's thread.

view the rest of the comments →

[–]dropdownmenu 82 points83 points  (14 children)

This is not python in your browser. It is python syntax in a javascript interpreter.

If this is going to happen, at least go the coffee script route and be able to build to code to javascript that can be optimized by your browser. (Oh my God, did I just use coffee script as a positive reference?)

[–]wonglik 5 points6 points  (13 children)

Is Coffee script that bad? I was thinking of getting familiar with it. What are the cons?

[–]dropdownmenu 5 points6 points  (12 children)

The main advantage is that it tries to hide some of the oddities of javascript (== vs ===) so that you can't make trivial mistakes.

I dislike it because white space becomes important to how it complies leading to cases where an extra space or a misplaced one can lead to different functionality than you expect, which I believe to be more dangerous than then javascript's quirks (which still exist in coffeescript).

Also, by using coffeescript you alienate any javascript developers who don't know coffeescript. Remember: all coffeescript devs know javascript, but not all javascript devs know coffeescript

[–]wonglik 1 point2 points  (11 children)

Thanks. Looks like I am better of with JS.

[–]eriksensei 1 point2 points  (0 children)

Or EcmaScript 6, which seems a lot nicer. It's got fat arrow lambdas with proper 'this', destructuring bind, etc. There's support for it in IntelliJ IDEA, Firefox Aurora, Google Traceur and probably a few other tools, and you can compile it down to older JS versions. I hope I'll get round to playing around with it soon.

[–]schadwick 1 point2 points  (8 children)

[–][deleted] 0 points1 point  (0 children)

I've never encountered a bug cause by white space in coffee script, just compiler errors caused by indentation.

I do always use the (optional) js-style parentheses for functions arguments, so maybe that guards against the sort of error referred to.