[Mono-list] Style

Eric Kidd eric.kidd@pobox.com
01 Mar 2002 23:50:56 -0500

On Fri, 2002-03-01 at 04:15, Miguel de Icaza wrote:
> I try to fit as many things as possible in 110 columns, but we should
> probably standarize in 80 columns.

It would be very, very nice to fit any new Mono code into 80 columns
whenever possible (79, actually, if you don't want to wrap in Emacs).

I use big fonts on a tiny laptop screen (so I don't go blind from
hacking too much), and much of the Mono code simply doesn't fit unless I
shrink my Emacs fonts down to microscopic sizes.

As Linus writes, in the kernel's CodingStyle:

  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. 

This is a very good argument for using 8-space identation.

However, it is not such a good argument when you use anywhere from 5 to
14(!) consecutive tabs in a source file, or include the following 238
column line (which isn't actually the longest in Mono):

                                System.Diagnostics.Debug.Fail("System.Web.Cache.Dispose() Exception when closing cache entry", "Message: " + objException.Message + " Stack: " + objException.StackTrace + " Source:" + objException.Source);

If you're going to use huge indentation, you would make many of us happy
by keeping it to 4 or 5 levels, and sticking to 79 columns (or at least
the official 110 or so). ;-)