[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Code cleanup (was: Re: Can we do it: variable scoping)

From: Paul Smith
Subject: Code cleanup (was: Re: Can we do it: variable scoping)
Date: Sun, 14 Nov 2010 15:55:22 -0500

On Tue, 2010-11-09 at 21:40 -0500, David Boyce wrote:
> However, from what I've seen of the code it's way overdue for some
> cleanup[*] and IMHO trying to add and support new features on top of
> the current code base is trouble. I think it would be better to burn a
> (short) release cycle on a basic cleanup, uncomplicated by any
> functional change, then think about features in the subsequent
> release. This could be as simple as setting up a standard indent
> profile and running indent on all .c files, then splitting porting
> hacks out from ifdefs into platform-specific files. Plus adding a few
> strategic abstractions and maybe a little naming convention work.

I hear you.  Although, I think the large majority of the formatting
(indent etc.) is clean.  The exception would be contributed ports such
as the code to support Windows (in the w32 directory for example), where
I don't really sanitize things.

The major issue with make is the ifdefs, but the interesting thing, if
you look at it, is that MOST (not all) of the ifdef'd code involve small
changes to larger algorithms.  For example you might have a 100-line
function and in there you'll have three or four ifdef blocks that make
minor tweaks for a given platform.  It's hard to read, yes.  But it's
often not so simple to find a way to abstract JUST those three or four
bits of code in a reasonable way... and the alternative is breaking out
larger blocks of the algorithm and living with a lot of duplication of
code between the different ports.

I do agree there's a good bit of opportunity for cleanup even so,

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]