Should I match the curly brace usage of the previous author?

Posted by Error 454 on Stack Overflow See other posts from Stack Overflow or by Error 454
Published on 2011-01-07T01:40:08Z Indexed on 2011/01/07 1:53 UTC
Read the original article Hit count: 472

When working on code from multiple authors, I often encounter the issue of curly-brace preference (same line vs new line). Is it good/bad practice or even a non-issue when it comes to matching the existing style vs using your own preference?

Does the situation change if you are adding new code to a Class vs modifying existing code? Finally, if style should be matched, how far should the match propagate? i.e. the file, the class, subclasses etc.

Example:

if(this)
{
    doThat();
}

Vs.

if(this){
    doThat();
}

© Stack Overflow or respective owner

Related posts about coding-style

Related posts about style