[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KDE codeing style guide?
From:       Neil Stevens <neil () qualityassistant ! com>
Date:       2001-06-11 12:50:20
[Download RAW message or body]

On Monday 11 June 2001 05:26 am, Dirk Mueller wrote:
> On Mon, 11 Jun 2001, Jonathan Belson wrote:
> > Personally I use 4 space tabs for C since this is the best compromise
> > between clarity and screen width - any decent editor will allow
> > you to change your tab settings.
>
> yes, and it will break when you break function parameter lists, like
>
>   funky("Foo", lots of stuff here
>          "bar");

You use tabs for indenting blocks of code, according to the flow of the 
program.  You use spaces for formatting code.  The two kinds of whitespace 
serve fundamentally different roles, as different as the space and the 
newline.

In your example, funky("Foo"... and "bar".. should have the same level of 
indentation, the same number of tabs.  But, to line up "bar" with the 
other stuff, that's pure formatting.  You use spaces to do the rest.

This way, the code looks readable for *everyone*, whether he uses 
two-space tab width (I see that a lot), four-space, or even an 
old-fashioned terminal eight-space.

-- 
Neil Stevens
neil@qualityassistant.com
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic