[MUD-Dev] Languages

Ben Greear greear at pollux.cs.uga.edu
Thu May 22 21:34:18 New Zealand Standard Time 1997


First of all, thanks for the envite to the group.  It is definately a far 
cry from usenet!

On Thu, 22 May 1997, Caliban Tiresias Darklock wrote:

> Chris Gray wrote:
> > 
> > I've read enough on C++ to know
> > that its unlikely I'll ever use it, and I fail to see any contributions
> > it has made to the state of the art (fight'n words, I know!). I do need
> > to read up on Java, however.
> 
> AMEN!!!!! I have offered the same two challenges to every C++ programmer
> I've met. No one has ever satisfactorily responded.
> 
> 	1. Show me one thing object oriented programming does which proper 
> 	structured programming discipline can not.
> 
> 	2. Show me one C++ construct that is impossible to implement in C.

One of my favorite features is templates.  Sure, it's not incredibly 
optimum when finally compiled (ie the compiler just rewrites the class 
for each different dayatype you template, but from teh coders standpoint, 
it gives a lot.

Also, while you can do it all in c, classes and member functions, 
especially destructors and constructors are nice shorthand.  One of the 
big arguments against c++ IMHO is that most ppl make all data members 
private, and thus have functions to read/set each of them.  In a MUD, 
this is usually a big pain in the arse, as well as innefficient in many 
cases. 

For this reason I use a bastardization of c++.  I use all the goodies of
member functions, and leave as many variables public as is convenient for me.
This goes against OO, but I see no reason to make my life harder just to
fit some abstract model of how someone thinks I should do something.

> 	1. Inheritance. I respond, 'void *parent'.
Yep, and you can do it all with pointers to sub (classes/structs).  I 
haven't actually used inheritance yet, but I plan to on the next game I
write...  Then I'll have a better informed opinion...

> 
> 	2. Methods in classes. I respond, 'int (*method)()'.

This works, but is a tad messy IMHO.

> readable. But starting from a blank text file and using no class
> libraries at all, just the standard C and C++ compiler libraries, C++
> ends up looking an awful lot like C... except that it runs slower, has a
> fatter binary, and took a good deal longer to write. ;>

I'm curious about some things.  What exactly makes c++ slower?  Is it 
more class calls because most ppl make accessing class data a function 
call?  Perhaps inheritance mapping of some sort?  I head that a c++ 
compiler basically just translates the code into c before compile anyway..


> 
> The benefits of C++ are in code reuse, but code reuse is not always an
> appropriate thing, and you have to have some C++ code to reuse first.

I concur.  And to be honest, the only code I reuse is my own, but perhaps 
if I was willing to wade through more manuals, and more libs were free
(and came w/a good manual) I'd use other ppls.  Fortunately 4 yrs of 
school have yielded several good classes to work with :)

Ben Greear                 |  "He said he let the bottle do the thinking,
greear at pollux.cs.uga.edu   |   but you can't shake the Devil's hand and 
www.cs.uga.edu/~greear     |   say you're only kidding.  --TMBG




More information about the MUD-Dev mailing list