Judson Powers <powers@RJSONLINE.NET> writes: > IMO, Circle should switch over to C++. Not only does it tend to be more > well-organized and understandable, the use of accessor functions lets you > do a whole lot with the code that's difficult to impossible using the > current structure. C++ definitely has benefits. However, circle is C code. It's design is centered on that. A proper C++ mud would have a very different design, unless you mean to just take a few nice parts of C++ and throw them in. I believe there are C++ conversions, maybe even split code bases, as well as muds designed entirely for C++ (mud++ comes to mind). I have to take issue with your saying that C++ will make circle more organized and understandable. Like any language, bad C++ design can create truly hideous code. C++ in and of itself doesn't make for prettier code. In fact, much more time must be spent in the design stages, otherwise things get ugly (with the tradeoff of less time being needed in actual coding, if the design is right). C can be every bit as elegant as C++. It's the coder and the design that makes code elegant, well-organized, and understandable, not the language. (Okay, there are some exceptions, but once you grok a language and fully understand it, then you can see through the language's barriers to readabiliti... like lisp *inno*). > Polymorphing would be a good example. If you polymorph "Darien", a player, > into "a big grey wolf", all of your data access macros are directly > accessing his stats -- you'd have to change the stats in his record and > store the originals elsewhere to pull it off. (Unless I'm totally > overlooking something, or unless you want to add a _lot_ of code.) > Accessor functions, on the other hand, make this a rather simple operation. > And with compiler settings, they inline automatically! Of course, it might be easier to use code similar to do_switch() (not a switch/case statement). Accessor functions aren't limited only to C++, though, and as the macros vs functions argument has brought up, using accessor functions in C would allow just the same flexibility. C++ has some great features that we can borrow without the need for huge changes at just about every level of circle... doing a proper C++ conversion, though, would be much more work (and by proper I mean fully adhering to the philosophy, style, and design of the C++ language, not just tossing C code into a C++ compiler). -- James Turner turnerjh@xtn.net http://www.vuse.vanderbilt.edu/~turnerj1/ +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST