Hi Kenneth,

All the code snippets you gave are correct per our coding style.

- WBR, Alexey Proskuryakov


04.06.2009, в 18:52, Kenneth Christiansen написал(а):

Hi there,

I'm having a question regarding the coding style.

According to 2. An else statement should go on the same line as a
preceding close brace.

I would always need a brace when using if-else, in order to but the
else statement on the same line as the preceding close brace, is this
right?
or would something like this is OK:

if (condition)
   func1();
else
  func2();

And what about this case

if (condition)
   func1();
else {
  func2();
  func3();
}

It would be nice to have this defined in the coding style,  as well as
adding the case that when you have a comment inside a one line if
statement you will need braces, like

if (condition) {
    // comment
    func()
}

Cheers, Kenneth
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev



_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to