[Home] [Groups] - Message: [Prev in Group] [Next in Group]
7402: [MUD-Dev] Let's talk about numbers.
[Full Header] [Plain Text]
From: "Jon A. Lambert" <jlsysinc@ix.netcom.com>
Newsgroups: nu.kanga.list.mud-dev
Date: Fri, 25 Sep 1998 01:59:33 -5
References: [1]
Organization: Kanga.Nu
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@ix.netcom.com /*\--
--/*\ Mud Server Developer's Page <http://www.netcom.com/~jlsysinc> /*\--
--/*\ "Everything that deceives may be said to enchant" - Plato /*\--