Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Jun 1999 19:01:11 -0400
From:      "Christopher R. Bowman" <crb@ChrisBowman.com>
To:        Nate Williams <nate@mt.sri.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: 3.2-stable, panic #12 
Message-ID:  <199906042302.TAA39240@quark.ChrisBowman.com>
In-Reply-To: <199906041508.JAA27044@mt.sri.com>
References:  <199906040223.TAA01897@apollo.backplane.com> <199906040145.CAA04373@keep.lan.Awfulhak.org> <199906040223.TAA01897@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 09:08 AM 6/4/99 -0600, Nate Williams wrote:
>[ 
>  None of the below is assumed to be taken as reflecting any situation
>  that occurred in FreeBSD.  This is a *common* problem that exists in
>  every software program, and any reflection on what happened in FreeBSD
>  is by coincedence in that it's a software program.  My comments apply
>  as easily to my situation with the laptop support changes I made as it
>  done to *any* other portion of the system.
>]
>
>>     The biggest mistake that programmers working on a large project make is
>>     when they do *not* rewrite portions of the code that need to be
>>     rewritten.
>
>Most good software engineering books would disagree with you.  The
>*BIGGEST* mistake the most programmers make is re-writing functional
>code to conform to their style of programming, rather than understand
>why the original programmers did it the way they did it.
>
>NIH is *FAR* too common of a problem.  Bugs *rarely* require a complete
>re-write of the code.
>
>This isn't to say that often-times it's *easier* to just re-write it
>from scratch than it is to understand what the original code was doing
>in the first place, but this often leads to errors that were fixed by
>the original authors in a non-obvious manner being brought back in.
>
>The above problem is almost always a problem with the original author
>not doing a proper job of documenting the work, but it doesn't justify
>ripping everything out and starting over from scratch.
>
>I know of *NO* programmer who does not delight in completely ripping out
>and replacing existing code with code that he has written from scratch.
>It's great fun, and it allows the person to feel better about the
>system, themselves, and make sure that they can debug the existing code
>better.  I do it all the time.  But, I know for a fact that it's rarely
>the right thing to do, especially when the folks who 'went before me'
>aren't 1st year CS students, but are seasoned professionals who have a
>clue and didn't do things on a whim.
>
>Almost *ALL* of the BSD kernel code (and most of the userland code as
>well) falls into the class of code that is written by seasoned
>professionals.  They are not infallible, but they almost always have a
>reason for why they did things the way they did.
>
>Does it mean you should never re-write entire portions of code?  Of
>course not, but it should never be taken lightly, and *IF* the original
>programmers are there and willing (and capable) to explain things to
>you, then that should be taken advantage of, and not ignored.

To amplify and extend Nate's excellent points I would like to contribute 2 of
my own:

1) in a project as large as freebsd in terms of the number of people that read
the code (and there are a lot more of us that read that you probably don't know
about).  When you rewrite that code for one of the reason listed above, you
loose all those people that may have read and understood the old code and would
understand a small patch or fix, but will need much more time to understand the
new code or worse won't put in the effort.  We might even loose potential
devolpers this way.

2) when our code diverges radically from its origins simply because it is
easier to rewrite than to read, we loose the ability to import features and
fixes from the other BSD projects.

I am not saying that this has happened, I am just suggesting that we keep these
things in mind. 
--------
Christopher R. Bowman
crb@ChrisBowman.com
http://www.ChrisBowman.com/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906042302.TAA39240>