DEV Community

Discussion on: Modern Full-Stack Developer Tech Stack 2021

Collapse
 
ninadd profile image
ninad

Agree. Problem is you wanted a banana but with the banana you got the Gorilla and the whole Amazon rainforest with it.

Collapse
 
efpage profile image
Eckehard

"Well, maybe in react you do not get a banana without a gorilla (does he not even look a bit like Mark Zuckerberg?). But this is not a fault of OO, it is more a result of over-use of a concept, that does not apply very well to the task."

from: What´s wrong with the gorilla?

chimpanzee

Collapse
 
ritin profile image
Ritin

lol.
The "Monkey and Banana"
Classes and multple Inheritance.

Thread Thread
 
efpage profile image
Eckehard
Thread Thread
 
ritin profile image
Ritin • Edited
class A                     { public: void eat(){ cout<<"A";} }
class B: virtual public A   { public: void eat(){ cout<<"B";} }; 
class C: virtual public A   { public: void eat(){ cout<<"C";} }; 
class D: public         B,C { public: void eat(){ cout<<"D";} }; 

int main(){ 
    A *a = new D(); 
    a->eat(); 
} 

I…

  1. Bloated Code. Why should you have to write code for Class C and Class B? When All you want todo is use Class D

  2. You have to worry about the whole Heirarchy (eg, the whole jungle).
    Debuging becomes harder. On instantiation of D was B called or was it C?

The above example is the simplest to illustrate the point. Imagine production scenarios with deep heirarchy.

Thread Thread
 
efpage profile image
Eckehard

Why do you do it this way, if there is a simpler and better approach? You can use a hammer to drill a hole, but maybe that is the wrong tool for the task.