<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] Let's talk about numbers. --> <!--X-From-R13: "Xba O. Znzoreg" <wyflfvapNvk.argpbz.pbz> --> <!--X-Date: Thu, 24 Sep 1998 22:59:34 -0700 --> <!--X-Message-Id: 199809250559.AAA12879@dfw-ix14.ix.netcom.com --> <!--X-Content-Type: text/plain --> <!--X-Reference: 199809240523.AAA14210@dfw-ix10.ix.netcom.com --> <!--X-Reference: 199809241515.IAA02072#cashew,snugharbor.com.snugharbor.com --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, [MUD-Dev] Let's talk about numbers.</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:jlsysinc#ix,netcom.com"> </head> <body background="/backgrounds/paperback.gif" bgcolor="#ffffff" text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000"> <font size="+4" color="#804040"> <strong><em>MUD-Dev<br>mailing list archive</em></strong> </font> <br> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg01212.html">Previous</a> | <a href="msg01214.html">Next</a> ] Thread: [ <a href="msg01192.html">Previous</a> | <a href="msg01221.html">Next</a> ] Index: [ <A HREF="author.html#01213">Author</A> | <A HREF="#01213">Date</A> | <A HREF="thread.html#01213">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>[MUD-Dev] Let's talk about numbers.</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> <LI><em>Subject</em>: [MUD-Dev] Let's talk about numbers.</LI> <LI><em>From</em>: "Jon A. Lambert" <<A HREF="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</A>></LI> <LI><em>Date</em>: Fri, 25 Sep 1998 01:59:33 -5</LI> <LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> On 24 Sep 98, T. Alexander Popiel wrote: > In message: <<A HREF="msg01177.html">199809240523.AAA14210#dfw-ix10,ix.netcom.com</A>> > "Jon A. Lambert" <jlsysinc#ix,netcom.com> writes: > > > >I agree, we should always attempt an implementation in terms 0, 1 > >and many(unknown/infinity/X). There are exceptions and instances > >where we must pay homage at some level to the failings of our > >silicon, but these should be rare and abstracted if possible. > > > >It begs the question, "Is the fixed dimensional array evil?" > > I'd tend to say that no, fixed dimensional arrays are not evil, if > properly marked. I submit these excerpts from the string table code > I mentioned a few posts ago as my defending argument: > > /* This is a string table implemented as a red-black tree. [snip] > #define ST_MAX_DEPTH 64 [snip] > * The fixed size of this array puts a limit on the maximum > * size of the string table... but with ST_MAX_DEPTH == 64, > * the tree can hold between 4 billion and 8 quintillion > * strings. I don't think capacity is a problem. > */ > static StrTree *path[ST_MAX_DEPTH]; > Well in this case it seems reasonable enough. But let me make an argument for another way... At initialization, a configuration file is read that sets st_max_depth to some value. Then you allocate your tree later on .. StrTree *path; path = (StrTree *) malloc(st_max_depth); Like I said in this case, it may not be reasonable. OTOH, There are cases where one wants to configure a minimum capacity due to storage constraints. Or perhaps wants to tune a cache. You force an issue where changes to a system require a re-compile. What about things like: char MudTitle[65]; #define MAX_ROOMNUMS 9999 #define MAX_STRING 80 #define FIRE_BIT 2^4 I certainly see where system level code must conform to hardwired limitations. And where it exists, it should be localized as much as possible. But why should application level code be static? Why not runtime configurable? This may not be a major issue for those running softcode engines like MudOS, DGD, Cold or PennMUSH since much of the code is at this level is system level code. Although it may pose maintenance issues in the softcode itself (mudlibs, dbs). But for hardcoded servers it is a major issue. Yes, servers like Diku may have templatized the Player, the Object, the Room. But the routines for processing that information are not and are subject to some awful hardcoded limits. This is just a design technique that I think it's wise to pay close attention to when writing code. -- --/*\ Jon A. Lambert - TychoMUD Internet:jlsysinc#ix,netcom.com /*\-- --/*\ Mud Server Developer's Page <<A HREF="http://www.netcom.com/~jlsysinc">http://www.netcom.com/~jlsysinc</A>> /*\-- --/*\ "Everything that deceives may be said to enchant" - Plato /*\-- </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <ul compact><li><strong>Follow-Ups</strong>: <ul> <li><strong><A NAME="01221" HREF="msg01221.html">[MUD-Dev] Re: Let's talk about numbers.</A></strong> <ul compact><li><em>From:</em> "T. Alexander Popiel" <popiel#snugharbor,com></li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <UL><LI><STRONG>References</STRONG>: <UL> <LI><STRONG><A NAME="01177" HREF="msg01177.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG> <UL><LI><EM>From:</EM> "Jon A. Lambert" <jlsysinc#ix,netcom.com></LI></UL></LI> <LI><STRONG><A NAME="01192" HREF="msg01192.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG> <UL><LI><EM>From:</EM> "T. Alexander Popiel" <popiel#snugharbor,com></LI></UL></LI> </UL></LI></UL> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg01212.html">[MUD-Dev] Let's talk about numbers.</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg01214.html">[MUD-Dev] Let's talk about numbers.</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg01192.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg01221.html">[MUD-Dev] Re: Let's talk about numbers.</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#01213"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#01213"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> <ul><li>Thread context: <BLOCKQUOTE><UL> <LI><STRONG>[MUD-Dev] Let's talk about numbers.</STRONG>, <EM>(continued)</EM> <ul compact> <ul compact> <ul compact> <ul compact> <ul compact> <ul compact> <LI><strong><A NAME="01216" HREF="msg01216.html">[MUD-Dev] Let's talk about numbers.</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 06:00 GMT </LI> </ul> <LI><strong><A NAME="01186" HREF="msg01186.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, Marc Hernandez <a href="mailto:marc#jb,com">marc#jb,com</a>, Thu 24 Sep 1998, 06:41 GMT <UL> <LI><strong><A NAME="01212" HREF="msg01212.html">[MUD-Dev] Let's talk about numbers.</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 05:59 GMT </LI> </UL> </LI> <LI><strong><A NAME="01192" HREF="msg01192.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, T. Alexander Popiel <a href="mailto:popiel#snugharbor,com">popiel#snugharbor,com</a>, Thu 24 Sep 1998, 15:15 GMT <UL> <LI><strong><A NAME="01213" HREF="msg01213.html">[MUD-Dev] Let's talk about numbers.</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 05:59 GMT <UL> <LI><strong><A NAME="01221" HREF="msg01221.html">[MUD-Dev] Re: Let's talk about numbers.</A></strong>, T. Alexander Popiel <a href="mailto:popiel#snugharbor,com">popiel#snugharbor,com</a>, Fri 25 Sep 1998, 15:03 GMT <UL> <LI><strong><A NAME="01232" HREF="msg01232.html">[MUD-Dev] Re: Let's talk about numbers.</A></strong>, Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Fri 25 Sep 1998, 20:30 GMT <UL> <LI><strong><A NAME="01235" HREF="msg01235.html">[MUD-Dev] Re: Let's talk about numbers.</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 22:36 GMT <LI><strong><A NAME="01247" HREF="msg01247.html">[MUD-Dev] Re: Let's talk about numbers.</A></strong>, Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Sat 26 Sep 1998, 03:31 GMT </LI> </LI> </UL> </LI> </UL> </LI> </UL> </LI> </UL> </LI> </ul> </ul> </ul> </ul> </ul> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>