Advertisement

What are the advans/disadvans of using class member functions vs normal functions?

Started by April 19, 2000 08:22 AM
20 comments, last by Possibility 24 years, 7 months ago
I think a lot of people worry about the ''hidden'' costs of inheritance, so instead they make a single class with a type variable saying which subtype it is, and use switch statements all over the place. I can understand why - it''s difficult to trust code you can''t see. However, apart from the extra time it takes to code all those switch statements, you also introduce more potential places for bugs. But the main thing is that almost no switch-based subtype implementation is gonna be significantly faster than vtable lookups anyway. So you don''t gain much Sensible use of objects cuts development time and source code size, leaving you more time to work on gameplay!
I have to thank null_pointer for telling me what OOP actually is, and the cool thing is, I have already been doing that, and alot. It just seemed like a natural thing to do my coding that way.

Possibility

This topic is closed to new replies.

Advertisement