Opened 15 years ago

Closed 15 years ago

#1661 closed defect (fixed)

JS Style Guide examples don't follow rules - if(foo) vs. if (foo)

Reported by: skinner Owned by: Neil Roberts
Priority: lowest Milestone: 0.9
Component: Doc parser Version: 0.3
Keywords: Cc:
Blocked By: Blocking:


On the Dojo coding style guide web page, the example code doesn't follow all the layout rules listed on the page:

In the "Layout" section, under "Whitespace", it says:

2. Reserved words SHOULD be followed by a space.

But in most of the example code in the "Layout" section, the reserved words are not followed by a space. For instance, the first example in the "Layout" section reads:

    isDone = moreToDo();

rather than:

while (!isDone){
    isDone = moreToDo();

Oddly, some of the example do include occassional spaces after reserved words:

}while (condition);
switch (condition){
}catch (ex){

Seems like we should either change the example code or change the rule.

Change History (2)

comment:1 Changed 15 years ago by neil

Owner: changed from neil to Neil Roberts

comment:2 Changed 15 years ago by alex

Resolution: fixed
Status: newclosed

I've updated the style guide to be un-ambiguious regarding these whitespace issues:

Note: See TracTickets for help on using tickets.