|
1. Turning a C coded mud into a C++ coded mud.
|
|
Sun Apr 11, 2004 [10:10 PM]
|
Kardis
freaky_god@hotmail.com
member since: Mar 24, 2003
|
Reply
|
|
Hi everyone,
I have a very diffcult task ahead of me and I was wondering if anyone could enlighten me. I have a mud that me and my buddies are working on, and almost all muds are coded in C, at least that was my friend who I'm helping told me. We are running UNIX, but the thing of it is that we want the code to be C++ (Better code altogether and updated code, unlike C, means a better running mud.) and we want to convert all of the code of C to C++. Can anyone tell me how how this could be achieved and is it possible to accomplish. I think it can be, but can someone break it down for me.
Thank you.
Kardis
|
|
|
|
|
2. RE: Turning a C coded mud into a C++ coded mud.
|
|
Mon Apr 12, 2004 [8:06 AM]
|
Genghis
Email not supplied
member since: Mar 24, 2000
|
In Reply To
Reply
|
|
1. In your Makefile, change the "CC" value from "gcc" to "g++". 2. Change all your filenames from ".c" to ".cpp" 3. Repair any compile errors that occur due to type/const restrictions that C doesn't check for.
There, now your mud is in C++.
|
|
|
Keyboard missing. Think F1 to continue.
|
|
3. RE: Turning a C coded mud into a C++ coded mud.
|
|
Mon Apr 12, 2004 [10:35 AM]
|
Tharn
Email not supplied
member since: Aug 31, 2002
|
In Reply To
Reply
|
|
Although you say it like its easy.. :P
Its not too bad, I would suppose. Just tedious work to fix all those little bugs it comes up with.
|
|
|
|
|
4. RE: Turning a C coded mud into a C++ coded mud.
|
|
Mon Apr 12, 2004 [12:51 PM]
|
Kardis
freaky-god@hotmail.com
member since: Mar 24, 2003
|
In Reply To
Reply
|
|
Thank you, it is quite easy, lol.
Thank you a billion times over.
:-)
Kardis
|
|
|
|
|
5. RE: Turning a C coded mud into a C++ coded mud.
|
|
Thu Apr 22, 2004 [12:41 AM]
|
Xeon
Email not supplied
member since: Jul 12, 2002
|
In Reply To
Reply
|
|
Hahahaha!
OMG...
I posted this awhile back with a similar question to yours: Don't be stupid like I was. Do the books you read not advocate consistency? Trying to add OO to a 100% C monster such as Smaug would introduce inconsistencies, confusion, and eventually unwieldy code. Adding a few objects with nifty constructors would be completely unnessessary, especially since one cannot experience the full benefit (or ANY benefit, IMHO) of OO without redesigning (read: creating a new, custom codebase) the entire code.
Also, C++ is not the be-all, end-all solution to programming. A well coded C mud is 1000x better than a half C, half C++ one.
Take the word of someone who was stupid enough to actually try this: It's not worth it and you will end up wasting time, not to mention: YOU WILL LEARN BAD PROGRAMMING HABITS!
If you learned nothing else from this post, please keep in mind what I just stressed.
-Xeon
|
|
|
"Imagination is more important than knowledge." -- Albert Einstein
|
|
6. RE: Turning a C coded mud into a C++ coded mud.
|
|
Thu Apr 22, 2004 [2:17 AM]
|
KaVir
Email not supplied
member since: Aug 19, 1999
|
In Reply To
Reply
|
|
> Trying to add OO to a 100% C monster such as Smaug would > introduce inconsistencies, confusion, and eventually > unwieldy code.
The original poster didn't mention anything about wanting to write OO code - all he said was that he wanted to use C++. Remember, C++ is a multi-paradigm programming language, not an exclusively Object Oriented one.
|
|
|
|
|