Re: Existence Based Polymorphism
Tom Plunket <[email protected]>
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <[email protected]> |
Richard Fabian wrote: > > I've been thinking about this a lot over the last few months, and come to > think that if OOP was not "bad", then there wouldn't be so many "effective > C++" or "C++ gotchas" like books out there. How many "pitfalls of procedural > development" books have you seen? It's worth a mention that many of the tips and tricks are not specific to OOP, like exception handling and RTTI, then the "smaller" things like pointer safety, containers, const correctness, and references. > Although OOP does have abstraction nailed... Conceptually, it may. In practice, though we see a lot of procedural code wrapped in classes. This doesn't make the code OOP, even if on the surface it looks like OOP. Consider a class with all static methods and maybe even some static data. Beyond the "class" keyword, where's the OOP? > Encapsulation is better handled by C. Being that C++ is largely a superset of C, I don't see how this is possible. > This can be seen in how you cannot actually hide all the implementation > details in C++ without using techniques such as pImpl or virtual base > classes. Each of which actually impacts performance in some way. What methods are used in C to hide these implementation details? The only thing I can think of is "opaque structures," which is not only available in C++ but encouraged by those "effective C++" books. -tom! -- _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com