Live data from Hacker News

The jQuery Divide:Understand where jQuery ends and JavaScript begins

slideshare.net

1–10 of 78 posts

Re: The jQuery Divide:Understand where jQuery ends and JavaScript begins

#3
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 JavaScript begins

#4
post #3

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?

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 JavaScript begins

#5
post #3

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?

No alternatives? Coffeescript is always an alternative to js: http://jashkenas.github.com/coffee-script/

Re: The jQuery Divide:Understand where jQuery ends and JavaScript begins

#6
post #3

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?

Use a good webframework http://ukijs.org/

Re: The jQuery Divide:Understand where jQuery ends and JavaScript begins

#7
post #3

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?

> 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 JavaScript begins

#8
I'm not so sure I buy the premise that jquery is unsuitable for large scale applications. I think it is based on an assumption that jquery should provide a framework for these things, but really - what jquery is, is a framework for the controller layer of an application. If you want to use it, you have to provide the model level framework your self. I don't think this is the fault of jquery anymore than it would be the fault of Sinatra.rb to not provide the functionality of Rails.

Re: The jQuery Divide:Understand where jQuery ends and JavaScript begins

#9
Hey! That's exactly how my jQuery code looks! I think I just got seduced by all the closurey goodness that comes with Javascript (my day-job languages don't let me do that.)

I'm not going to ask how to write good code, but I think this is a fair question: can someone point to a coding standard / style guideline for Javascript + jQuery?

E.g., when to choose a single-use named function over an anonymous function? When to bind jQuery results to variables vs. go crazy with chaining? Any advice on good selector practices? Good html naming conventions?

I'd love to see all that stuff documented in one place. It must be out there somewhere.

Post reply on HN