Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript Coding Examples

Tags:

javascript

I'm looking for an open-source JavaScript project from which I can learn about good coding practices, patterns, etc.

For example, the equivalent 'awesome code' example from Java would probably be the Spring project internals.

I've thought about taking a look at prototype / jquery, but are there any better ones (by better I mean greater return on time invested)?

I'm talking proper substance as you would find in a java / ruby project, as opposed to a 50 line snippet of code to animate my buttons - (Sorry that's probably a bit JavaScript-ist).

like image 337
lucas1000001 Avatar asked Jul 27 '10 23:07

lucas1000001


2 Answers

It seems like everyone has a different approach when it comes to javascript. In general I find the node.js source code to be pretty clean and straightforward... It's not browser scripting, which I think gives a good picture of 'pure' javascript code that doesn't mess with host objects or the DOM.

http://github.com/ry/node/tree/master/lib/

like image 160
Dagg Nabbit Avatar answered Oct 02 '22 11:10

Dagg Nabbit


updated answer post comment discussion

Reading one of the popular general purpose libraries would be instructive in it's own way, but if you just want to learn solid JavaScript, I would go with something else. There are lots of projects to choose from.

Three interesting ones (to me, subjective remember :D)

  • processing.js
  • raphael.js
  • node.js

I think picking two projects that do similar things and comparing how they accomplish things would be a good way to learn what makes good js code.

like image 37
µBio Avatar answered Oct 02 '22 11:10

µBio