Quote:
Originally Posted by Pierre-Marie Baty
I *know* how C++ works Mark, I've already written stuff in C++ and hacked proggies that were written in C++, but why do you guys all want to push me to switch over ?
|
PM, I have no idea of your understanding of C++.
My only intention, ok ok my TWO intentions ;-) were:
1) IF you have not spent much time with C++, then knowing that at first you can think of class as struct is an enormous benefit in getting over the initial jolt of the syntax and concepts of C++, of which most all C++ tutorials and books never mention… . So I didn't know but thought that IF you were just starting out with C++ I would throw this help your way, and also help anyone who may read this.
2) C++ Is much better IF it is properly used. Class global variables are way more organized then global or module global variables (static, global to a file). Functions associated with the data they operate on are way more organized then disparate global functions and data. The very first look I had at the pod source I thought all the wp stuff would be a perfect candidate for a class as well as a bot class.
If C++ is used improperly it can become nightmarish. A perfect example of this IMHO is the "standard" C++ practice everyone was pushing when the language came out, of having accessor functions to get/set all of the class variables!!!
So you tell me for a simple class with like 10 member variables I would go from managing ten variable names to 30 names (a get and set function name plus the original variable name! Not to mention writing the tiny functions themselves to get /set the actual variable) What A mess!
But well written C++ is much better to deal with, really it is. But still, even so it doesn't save any time in developing small to medium applications (if you consider the time to develop helper classes) . The calling object interface may become simpler, but the code underneath in the classes is just as complicated as it always was to write, with the exception of some help from well-designed helper-utility classes.
But C++ was a patched on upgrade to c (anyone remember the first c++ compilers that were preprocessors to turn the C++ into totally unreadable C that was then fed to your C compiler?) and many things were changed in C++ to "Fix" problems in C. And C++ isn't even "really" truly object oriented since Main() isn't an object!
The short answer, because well written C++ that takes advantages of the new features of the language is really much better to program in!
P.S.
Just having fun!