2.3.51 tulip broken

Michael Chaney mdchaney@doublewide.net
Thu Mar 16 16:42:00 2000


> > Ah, so replacing raw numbers with a defined constant, and thus adding
yet
> > another layer of complexity, will fix all your programming problems?
>
> In this particular case, no, apparently the values are dependent on each
> other.
>
> However, in general the approach is correct, as it results in easier
> code maintenance over the long term.  Basic software engineering.

I should have been a bit more specific.  I use constants quite often, when
it makes sense.  But the term "symbolic constant" is appropriate, and there
are often cases (very often in low-level code) that there is simply nothing
symbolized by the numbers, and they'll probably be used in only one place,
anyway.  In that case, you'd end up with:

#define A_BUNCH_OF_RANDOM_NUMBERS_THAT_MAKE_THE_21040_CHIP_HAPPY ....

It's very different than:

#define HITS_PER_PAGE ...

In the first case, and the case which the original poster was getting pissy
about, there is absolutely no advantage to adding the constants.  There are
a few disadvantages, though, namely that another layer of complexity has
been added.  Why bother?

Michael
--
Michael Darrin Chaney
mdchaney@michaelchaney.com
http://www.michaelchaney.com


-------------------------------------------------------------------
To unsubscribe send a message body containing "unsubscribe"
to linux-tulip-request@beowulf.org