[Mono-list] Class Library coding standards

Bob Smith bob@thestuff.net
Wed, 18 Jul 2001 21:18:19 -0400 (EDT)


You just dug your own grave with that argument.
It is very common for C# to use at minimum 3 levels of indentations.
Namespace, class, method at the very least. Thats not including the needed
if/while stuff which is very common in a method as well, so your talking
tipically no less then 4*8=32 spaces. Thats alot of waisted space.

On 18 Jul 2001, Nate Case wrote:

> On 18 Jul 2001 19:01:10 -0500, Tomas Restrepo wrote:
> > Hi Sean,
> >
> > > * We'd like to see 8 space tabs.  If you leave the tab character, that
> > > is also fine.
> >
> > Personally, I dislike 8 space tabs inmensly (4 is really my top limit :).
> > It's a pita to use in cases like this on which namespace-decl + class-decl +
> > method-decl already bring up three levels of indentation, for a nice total
> > of 24 wasted spaces. Specially bad if you're like me and like your code not
> > to go beyond 80 columns so it's easy to print :)
> >
>
> Here is an excerpt from the Linux kernel coding style document (see
> /usr/src/linux/Documentation/CodingStyle):
>
> ---[snip]---
> Tabs are 8 characters, and thus indentations are also 8 characters.
> There are heretic movements that try to make indentations 4 (or even 2!)
> characters deep, and that is akin to trying to define the value of PI to
> be 3.
>
> Rationale: The whole idea behind indentation is to clearly define where
> a block of control starts and ends.  Especially when you've been looking
> at your screen for 20 straight hours, you'll find it a lot easier to see
> how the indentation works if you have large indentations.
>
> Now, some people will claim that having 8-character indentations makes
> the code move too far to the right, and makes it hard to read on a
> 80-character terminal screen.  The answer to that is that if you need
> more than 3 levels of indentation, you're screwed anyway, and should fix
> your program.
>
> In short, 8-char indents make things easier to read, and have the added
> benefit of warning you when you're nesting your functions too deep.
> Heed that warning.
> ---[snip]---
>
> I'd say this view is fairly widely adopted among the open source
> community, but of course many people still disagree.  Nevertheless, it's
> what we use for Gnome as well.  The only type of arguments I can sort of
> understand against it in this situation is C# vs. C issues (if for some
> reason it's impossible to keep C# code under 80 columns with 8-space
> tabs)
>
>
> --
> Nate Case <nd@kracked.com>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>