News for hackers. Stuff that matters.
Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by perlgeek on Sunday April 10, 2011 @10:26AM (#2429506)
So, how does one become a good, non-spaghetti-code javascript developer for the web?

I don't really like js so far, but there are just no alternatives in some cases. And my code ends up like those counter examples. Where can learn how to organize it properly?

Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by ionfish on Sunday April 10, 2011 @10:33AM (#2429518)
James Coglan has written a lot [1] about these issues. His series on evented programming [2] is a good place to start.

[1] http://blog.jcoglan.com/

[2] http://blog.jcoglan.com/2010/02/21/events-theyre-not-just-fo...

Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by DanielRibeiro on Sunday April 10, 2011 @10:39AM (#2429527)
No alternatives? Coffeescript is always an alternative to js: http://jashkenas.github.com/coffee-script/
Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by bcrescimanno on Sunday April 10, 2011 @02:31PM (#2430048)
Coffeescript "compiles" to JS--so it's not an alternative to using Javascript; just an alternative syntax for writing javascript.
Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by dionidium on Sunday April 10, 2011 @06:30PM (#2430604)
Well, yeah, but you might as well say that JavaScript is just an alternative syntax for writing assembly language or machine code.
Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by DanielRibeiro on Sunday April 10, 2011 @06:15PM (#2430560)
Coffeescript is a different language though. It has different grammar, different keywords and so on. It shares the same object model, and it is usually used on compile form.

There are other alternatives as well[1], such as:

- LLVM languages: http://syntensity.blogspot.com/2011/04/emscripten-10.html

- HotRuby: http://hotruby.yukoba.jp/

- Smalltalk: http://clamato.net/

- Haxe: http://haxe.org/

- Mascara: http://www.mascaraengine.com/

And so on. Coffeescript is just closer to javascript than most alternatives. But it is a different language, and a nicer one in my humble opinion.

[1] https://github.com/jashkenas/coffee-script/wiki/List-of-lang...

Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by bcrescimanno on Sunday April 10, 2011 @07:46PM (#2430746)
I disagree that any language that "compiles" into another language can be considered an "alternative." I'm not bashing CoffeeScript; I haven't played with it much and don't know enough about it say anything one way or the other; but at the end of the day, the result is still Javascript.
Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by irahul on Sunday April 10, 2011 @11:44AM (#2429648)
> how does one become a good, non-spaghetti-code javascript developer for the web?

Just like anything else, it will take time and active effort. Till then, I suggest work with frameworks which help you structure your code. I use backbone.js and I have heard good things about YUI.

Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by augustl on Sunday April 10, 2011 @11:10AM (#2429584)
> So, how does one become a good, non-spaghetti-code javascript developer for the web?

Like everything else: throw a lot of time at it, and have a desire to make awesome things. Other than explicit feedback on written code, there is no one thing I could tell you to help you write better JavaScript for web browsers.

Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by chihiro on Sunday April 10, 2011 @11:01AM (#2429572)
Use a good webframework http://ukijs.org/
Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by Ruudjah on Sunday April 10, 2011 @12:27PM (#2429767)
GWT solves it for me while javascript has these problems.
Re:The jQuery Divide:Understand where jQuery ends and JavaSc... by bad_user on Sunday April 10, 2011 @03:59PM (#2430269)
IMHO, now you've got 2 problems.