What I always recommend to anyone who is interested in this kind of thing is: STICK TO WHAT YOUR TEAM DOES. If they use camelCase
for methods, you use it. If they use snake_case
for variables, you do it. If your team prefers spaces over tabs; use them.
Never go into a stablished team with standardized style changing things because it looks better unless it’s causing heavy problems.
If you’re not working on a team and you’re interested on using a coding style; then use the style of the libraries you use the most.
- If you use
jQuery
stick to jQuery Coding Style Guidelines - If you use
Closure
Library use JavaScript Google Coding Style - If you use
MooTools
Library use MooTools Coding Style Guideline
Organization wise, Closure is the best.. but to me somehow it feels like I’m reading JAVA instead of javascript. Go figure.