[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Coding style guidelines

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2007-09-03 18:32:19 CEST

Alexander Klenin wrote:
> Is there any coding style guidelines for TortoiseSVN?
>
> Most of them can be glanced from existing code, but, for example, I
> just found out that Stefan prefers class member functions to file
> scope functions. If I would know that, surely I would code it
> according to his preferences ;-)

We don't have strict style guidelines here. Sure, I'd like to keep the
style at least somewhat consistent, but that's not really enforced.
If you check the code, you'll find a lot of style 'violations'. For
example, the whole log cache was done by Stefan Fuhrmann, and that style
is a lot different than the rest of the TSVN code.
Just try to follow the 'main' style a little bit, use tabs, don't add a
space after every bracket.

> On a related note, is it really necessary to parenthesize even single
> variables and function calls in inside conditionals? For example is,
> if ((!bLogRes)&&(!m_path.IsUrl()))
> really preferred to
> if (!bLogRes && !m_path.IsUrl())
> ?

That's just my preference. You don't have to parenthesize single
variables if you don't want to. I usually do that to make sure when/if I
have to extend the condition that I won't run into problems because I
missed a parenthesis.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Mon Sep 3 18:29:22 2007

This is an archived mail posted to the TortoiseSVN Dev mailing list.