From: Stony Plain, Alberta, Canada
|I used to be a old-style C programmer. But since learning C++ several years ago, and programming with it most of the time since, I find myself automatically thinking in terms of "objects" when tackling a programming problem. I simply write down in words the problem I am attempting to solve, and voila, all the main nouns become classes and all the verbs become member functions.
But at what point does this approach become overkill? I mean, how do you decide between:
Is this purely a personal design issue, or is there practical reasons to choose one over the other? I read tutorials and books, and they are still doing the "old C-style" method for everything (verticies, polygons, weapons, players, etc.) while it would be really clean and easy (I think) to use objects instead. I've even been skimming some of the Quake3 code, and its ALL old-style. Why?
From: MD, USA
I'm an old-school ANSI C coder and have found it pretty tough to get into the OOP mindset. But I can say that I've found classes to be a BIG help in a number of ways. It makes code much cleaner and it allows me to focus on reusability. Does this mean I can't code straight C to be reusable and clean? No, but the point is that I DON'T typically do that. C++ kinda forces the issue...and I think that's a good thing.
I have heard that using things such as Virtual Functions and Inheritance can cause big slowdowns in code and that's a big reason why game developers don't use C++ to its fullest...but I'm such a neophyte in the realm of C++ that I can't support or deny that argument.
So...I know a lot of developers that use C++ and a lot of others that go the straight C route. Both will argue that they're way is the best. I would argue that whatever method you use that makes you actually sit down and CODE YOUR APPLICATION is the best one to use That's why I now use BlitzBasic