Why use OOP when OBP will do?
I'm curious to hear peoples opinions...
I find that in most of my applicatons - I do not need to use true object oriented programming (ie virtual base classes enabling the dynamic binding mechanism). I just write object based applications, involving composition and inheritance. It's just that all of the books seem to promote "OOP" which seems only necessary in massive applications of a certain kind. Thanks for listening! |
i would say it depends on what kind of thing your coding, i used "dynamic binding" not so long ago when coding the solution to a topcoder problem. the relevant code is below
Code:
struct node there are many things where dynamic binding can be very useful perhaps you have just never attempted anything where it would provide a significant improvement in some way. try the following examples without polymorphism a) create a parsing tree for some simple language b) drawing a list of drawable objects c) implementing different types of ai players(in a game) with a common interface you should find these much easier with virtual functions and base classes. |
Thanks kev82,
Pardon my late response, but my internet access is limited, and I had to think my way throgh your code. I actually see now, that I could have used this technique in previous applications to my advantage. Thank you again for the info. I feel like revamping some of my apps now :) Regards, unholy |
All times are GMT -5. The time now is 03:43 AM. |