C vs C++ (was Re: Ports)

From: Mike Redick (Telos@MAD.SCIENTIST.COM)
Date: 09/09/00


>        On the other hand, while muds are rather decent candidates for
>object oriented design via C++ classes, it is an investment between time
>and design.  There is no implicit declaration that writing something using
>c++ instead of C will result in quality.  In my opinion, it's far easier
>to write something that's lousy in C++ simply because you don't take
>advantage of all the things that make life simple, like templates/STL.
>
>        All you end up with is the slight memory bloat with C++ vs. C and
>other relevant issues.

Yeah... circle is probably about as organized as you can get with C. And
you're right, just using C++ doesn't make it automatically better.  But a
good C++ coder could probably get a much better design, with fewer bugs and
more efficiency.  And yes, obviously using templates and all the other cool
crap that comes with C++, that's the _point_ actually.  For instance a room
contains 3 linked lists... one each for objects, people and one for
scripts.  And all over the place there's code for inserting/deleting
objects into those lists.  Each function that touches those lists actually,
causing those sections of code to be repeated several times in memory.
Whereas in C++ the code would only be there 3 times total, one for each
list. Wouldn't that actually reduce the memory bloat you were referring to?

In any case the quality of the end product would be the result of the
coder's skill, no matter what laguage they use.

>
>        In this case though, it makes it incredibly easy for both myself,
>and others to use the pre-existing c code.  With the exception of
>replacing str_dup's with _stridup's (and a few others like that, since I
>didn't copy in all of the utilities), it was cut and paste, compile and
>go.
>        This means that alot of the relevant changes people make to their
>systems will be also nearly directly copyable.  The won't have to learn
>how to insert class members, with accessor functions or all that jazz.
>They can get a working product right away, by copying code they already
>know works.

Question on this... would it have been possible to simpy write an interface
that used the existing OLC files directly, such that we could just copy our
own files over yours and have it compile basically?  The reason being that
I've made some rather extensive changes to redit.c, and would rather not
have to go through it all again... heh.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT