nmh-workers
[Top][All Lists]
Advanced

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

[Nmh-workers] Re: Questionable code - the bigger picture


From: Bill Wohler
Subject: [Nmh-workers] Re: Questionable code - the bigger picture
Date: Sun, 15 May 2005 10:47:30 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Jon Steinhart <address@hidden> writes:

> In other words, I'm trying to incrementally revamp the code. So I
> don't just want to put off all changes for some future grand
> revamping, because I don't expect that that will ever happen.

That's probably true, so incremental refactoring seems reasonable.

> So what's the best way to go about this sort of thing?

Given the maturity, distribution, and complexity of the code, I would
suggest that any refactorings should be supported by unit tests. I
haven't looked at the MH code in a long, long time, but there weren't
any tests last time I looked, so the first step is to produce a unit
test framework with a "make test" entry point. Once this framework is
in place, you can produce a unit test which exercises the code you
intend to change. Then change it with confidence.

> So aside from this, the change that I would like to make is to
> collect all of the context handling functions into single
> sbr/context.c file.

Encapsulation is good.

-- 
Bill Wohler <address@hidden>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.





reply via email to

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