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

List:       evms-devel
Subject:    [Evms-devel] Re: Engine coding style (was assertion macro?)
From:       Andrew Clausen <clausen () gnu ! org>
Date:       2001-11-13 22:22:08
[Download RAW message or body]

On Tue, Nov 13, 2001 at 11:30:53AM -0600, Steve Dobbelstein wrote:
> > Which I find horrible.  I find more than 3 levels of indentation hard to
> > follow.  There are many instances of ~ 10 levels of indentation which
> > go off my 80 columns.  PITA!
> 
> I don't like code that has too many levels either.  I can get lost in
> remembering under which conditions a particular block of code is running.
> That said, I will admit that I am guilty of writing functions with many
> levels of indentation.  I write it as I think of the conditions that should
> be handled, which are usually many in number.  Some day in my free time
> (:P) I would like to go back and break the large functions into smaller,
> readable functions.
> 
> I am not too concerned about keeping code to 80 columns since most displays
> nowadays can handle more than 80 columns.

The code just "feels" too complicated if it goes over 80 columns.

> > Me neither.
> 
> I'm a big fan of single entry/single exit.  It comes from my days of having
> to debug assembly code and setting a breakpoint on the return from a
> function only to find that the breakpoint didn't get hit because someone
> put a return elsewhere in the code.  Yes, I'm showing my age.  Today's
> source level debuggers allow you to stop when a function exits regardless
> of which return was used.  So single exit may be a weak argument today.  I
> still like being able to look at the code and know exactly where it will
> exit.

Hehe, I'm a big fan of functional programming.  Indentation becomes
a moot point, because you rarely have functions bigger than 3 lines
anyway.

> I don't want to launch any coding style wars.  I appreciate your input.  I
> know we can't please everybody, but I would like to make the code
> acceptable to the widest audience, so I will take your comments into
> consideration.

OK, Thanks.  Basically, I don't complain (loudly ;) unless I find the code
hard to understand.  I guess I can get used to it...

Andrew


_______________________________________________
Evms-devel mailing list
Evms-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/evms-devel

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

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