Hi Shawn, Thanks for your links and your advices. Actually, all the coding standards stuff is almost defined and used over our projects.
But as I said, I'm looking for such common standards to organize the code, which will help a lot when collaborating. Here are my ideas: 1/ structure * logic directory tree matching the tree to package the code (like the java packages): /js/mymodule/myfeature.js * logic filenames : /sj/mymodule.myfeature.js (likes the jquery plugins). But the js directory can be a mess if there is a lot of features 2/ coding * Each feature must be a jQuery plugin ? This will stick us to jQuery, but as we use it, it's shouldn't be a problem * Each feature must be a JS class, or a kind of. Less coupling, but we should not use jQuery inside that code. What could be the pros & cons for each of these methods? Thanks, Noel On Wed, Oct 28, 2009 at 1:56 PM, Shawn <sgro...@open2space.com> wrote: > > When you are working in team environments, a common coding standard is very > helpful. > > What I do is to define the coding standard to be implemented for a project, > then do periodic code reviews to make sure the standards are being applied > as well as making sure the code actually works and is sound. > > (after thought - make sure your coding standards define how you'll do > indentation - 4 spaces, 1 tab character, etc....) > > Coding standards are common for a number of projects. I thought I had seen > one for jQuery but am not seeing it right now. I did find this one for the > jQuery.UI - http://jqueryui.pbworks.com/Coding-standards. Drupal has one > at http://drupal.org/node/260140, and Zend Framework's is at > http://framework.zend.com/manual/en/coding-standard.html (though it is > down for me at the moment). > > Code reviews should be done by someone who has sufficient background with > the project to understand the "big picture". These reviews should not be > done to ridicule anyone - there are syntax/logic issues, and then there are > style issues. Where you might use a while loop, someone else may use a for > loop - both are right, as long as the syntax and business logic are done > right. Don't harp on anyone for style issues, though mentioning it and > explaining why you use YOUR style can lead to some interesting discussions > and growth for everyone. > > Regarding best practices, I know there have been a few web postings for > jQuery/JavaScript best practices. Here's one: > http://www.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/ > > Best Practices and Coding Standards should ALL be subject to the job at > hand. That is, don't force the developers to jump through meaningless hoops > just to satisfy and "administrative" requirement. Allow deviations from the > target where it makes sense. On the other hand, getting all developers to > use a common standard for a project does help quite a bit when > collaborating. > > > > > Noel GUILBERT wrote: > >> Hello, >> >> I'm working on a document to standardize javascripts development for >> my team. >> >> Actually, each developer writes and organize its code in its own way, >> and it's currently a nightmare when an other developer have to work on >> the code of another. >> >> I've read a lot of interesting articles about javascript best >> practices, but all are about coding. There are not bad, but I'm more >> looking about packaging and organization. >> >> As we use jQuery for almost all our project, what is the best way to >> use jQuery to build RIA ? Should I build plugins for each feature ? >> How do you manage i18n and l10n ? >> >> Thanks! >> >> Noel >> >