[MUD-Dev] Let's talk about numbers.
Jon A. Lambert
jlsysinc at ix.netcom.com
Fri Sep 25 01:59:33 CEST 1998
On 24 Sep 98, Adam Wiggins wrote:
> On Thu, 24 Sep 1998, Jon A. Lambert wrote:
> > > On Tue, Sep 22, 1998 at 10:13:04PM -0500, Vadim Tkachenko wrote:
> > > > Again, why limit yourself with numbers like 50? Why not 500? Why not
> > > > just X?
> > [snip]
> > It begs the question, "Is the fixed dimensional array evil?"
>
> No. But designing/implementing something without the slightest
> thought for how you (or someone else) would be able to extend it
> someday is, IMO, one of the greatest failings of modern programing,
> and programmers themselves.
I fully agree with you. Even about the arrays being not evil. But
let's keep that to ourselves. ;)
> Programming 101: don't put magic numbers into the code.
Aye.
> make them easily locatable constants somewhere at the top with a
> clearly identifiable name.
Even better, make them external to the program.
> But a good implementation won't care if it's 10 or 50 or 5000.
Yes. Flexibility is also lower maintenance. This is good.
Also a routine that make no assumptions about a piece of data will
be less error prone than one that does.
--
--/*\ Jon A. Lambert - TychoMUD Internet:jlsysinc at ix.netcom.com /*\--
--/*\ Mud Server Developer's Page <http://www.netcom.com/~jlsysinc> /*\--
--/*\ "Everything that deceives may be said to enchant" - Plato /*\--
More information about the mud-dev-archive
mailing list