pgmpy / pgmpy_viz

A web based GUI for pgmpy
MIT License
13 stars 20 forks source link

Coding Style #18

Closed ankurankan closed 10 years ago

ankurankan commented 10 years ago

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?

[1] http://en.wikipedia.org/wiki/Naming_convention_(programming)#Python_and_Ruby [2] http://javascript.crockford.com/code.html

ankurankan commented 10 years ago

Coding style wiki at: https://github.com/pgmpy/pgmpy_viz/wiki/Coding-Style