There are some difference in the coding style of @pramttl and @omniscius. So I would like to have a wiki page over the coding style in javascript. @omniscius was inconsistent in his own code also.
So the first issue is having opening braces on the same line or the next:
if(a == b){
// do something
}
or
if(a == b)
{
// do something
}
If we go by the first way then should we have space after the condition like:
if(a == b) {
// do something
}
Another thing is having space after keywords like if, else, while etc
if (a == b) {
// do something
}
@omniscius was also inconsistent with variable names. He has used lower camel case and words_separated_by_underscore whereas @pramttl was using the standard python way[1].
I found this article[2] on coding convention for javascript and it looks good to me.
What do you guys think?
There are some difference in the coding style of @pramttl and @omniscius. So I would like to have a wiki page over the coding style in javascript. @omniscius was inconsistent in his own code also.
So the first issue is having opening braces on the same line or the next:
or
If we go by the first way then should we have space after the condition like:
Another thing is having space after keywords like
if
,else
,while
etc@omniscius was also inconsistent with variable names. He has used lower camel case and words_separated_by_underscore whereas @pramttl was using the standard python way[1].
I found this article[2] on coding convention for javascript and it looks good to me. What do you guys think?
[1] http://en.wikipedia.org/wiki/Naming_convention_(programming)#Python_and_Ruby [2] http://javascript.crockford.com/code.html