The Dirty Side of OOP
Edward Capriolo
For years people have been boasting of the benefits of OOP (Object Oriented Programming). However many people are unaware or at least refuse to accept the dangers of OOP.
Reusability- "OOP supports reusibiliy thats disgusting."
Protected functuions - Are they really safe?
A protected function is safer then other functions , but dont let the word protected fool you these functions could be very dangerous. The best way to stear clear is abstinence.
Volitile- Stay away from these functions. Volite functions
You see in C++ you have multiple inheritance this means that one child class can have multiple parent classes. This is an unfortunate situation for the child class as they are led into confusion and a number os serious problems
BabyDaddy1 class Babby Daddy2
class BabyMomma1 class
Eyes :Brown
Eyes:
Brown
Eyes:
Blue
|
|
|
\
/
\
/
Child Class
Eyes: Brown
In this situation a Child Class has the Brown eyes of the
father. But who is the father? with multiple parents C++ children can be
confused.
As you can see the child class is not sure if its brown eyes are from BabyDaddy1
or 2. The mother class will always say things like, " oh hes got his
daddies eyes"
GrandDaddy1 class
GramMommaClass
GrandDaddy2 class
\
/
\
/
MomaClass
DaddyClass
\
/
inbreed Babby class
As you can see this is a very difficult situation not only is Your Mommy Class your aunt class but your mutators are running amuck
.
But Java is no churchgirl either. Java supports the notion of cloning which has been banned by the president of the united states. Wh