Skip to main content
added 1 character in body
Source Link
tuket
  • 535
  • 5
  • 9

If youyour programming language supports multiple inheritance, you can inherit from both the Tree and the Warrior and get a TreeWarrior. C++ supports multiple inheritance:

class TreeWarrior : public Warrior, public Tree{
    ...
};

In Java you can't do this since it doesn't support multiple inheritance. The problem with programming languages like JavaScript is that there is no type safety.

I don't think object oriented programming languages are a limitation. In fact, JavaScript is an object-oriented programming language. I think your friend was thinking of Java as the limitation. Although there are tricks to simulate multiple inheritance in Java, I agree that it is a bit limited.

To answer the question about if he is underestimating the power of the object-oriented paradigm, I think yes. Just think of any AAA game. Most of them are programmed using C++.

If you programming language supports multiple inheritance, you can inherit from both the Tree and the Warrior and get a TreeWarrior. C++ supports multiple inheritance:

class TreeWarrior : public Warrior, public Tree{
    ...
};

In Java you can't do this since it doesn't support multiple inheritance. The problem with programming languages like JavaScript is that there is no type safety.

I don't think object oriented programming languages are a limitation. In fact, JavaScript is an object-oriented programming language. I think your friend was thinking of Java as the limitation. Although there are tricks to simulate multiple inheritance in Java, I agree that it is a bit limited.

To answer the question about if he is underestimating the power of the object-oriented paradigm, I think yes. Just think of any AAA game. Most of them are programmed using C++.

If your programming language supports multiple inheritance, you can inherit from both the Tree and the Warrior and get a TreeWarrior. C++ supports multiple inheritance:

class TreeWarrior : public Warrior, public Tree{
    ...
};

In Java you can't do this since it doesn't support multiple inheritance. The problem with programming languages like JavaScript is that there is no type safety.

I don't think object oriented programming languages are a limitation. In fact, JavaScript is an object-oriented programming language. I think your friend was thinking of Java as the limitation. Although there are tricks to simulate multiple inheritance in Java, I agree that it is a bit limited.

To answer the question about if he is underestimating the power of the object-oriented paradigm, I think yes. Just think of any AAA game. Most of them are programmed using C++.

added 498 characters in body
Source Link
tuket
  • 535
  • 5
  • 9

If you programming language supports multiple inheritance, you can inherit from both the Tree and the Warrior and get a TreeWarrior. C++ supports multiple inheritance:

class TreeWarrior : public Warrior, public Tree{
    ...
};

In Java you can't do this since it doesn't support multiple inheritance. The problem with programming languages like JavaScript is that there is no type safety.

I don't think object oriented programming languages are a limitation. In fact, JavaScript is an object-oriented programming language. I think your friend was thinking of Java as the limitation. Although there are tricks to simulate multiple inheritance in Java, I agree that it is a bit limited.

To answer the question about if he is underestimating the power of the object-oriented paradigm, I think yes. Just think of any AAA game. Most of them are programmed using C++.

If you programming language supports multiple inheritance, you can inherit from both the Tree and the Warrior and get a TreeWarrior. C++ supports multiple inheritance:

class TreeWarrior : public Warrior, public Tree{
    ...
};

In Java you can't do this since it doesn't support multiple inheritance. The problem with programming languages like JavaScript is that there is no type safety.

If you programming language supports multiple inheritance, you can inherit from both the Tree and the Warrior and get a TreeWarrior. C++ supports multiple inheritance:

class TreeWarrior : public Warrior, public Tree{
    ...
};

In Java you can't do this since it doesn't support multiple inheritance. The problem with programming languages like JavaScript is that there is no type safety.

I don't think object oriented programming languages are a limitation. In fact, JavaScript is an object-oriented programming language. I think your friend was thinking of Java as the limitation. Although there are tricks to simulate multiple inheritance in Java, I agree that it is a bit limited.

To answer the question about if he is underestimating the power of the object-oriented paradigm, I think yes. Just think of any AAA game. Most of them are programmed using C++.

Source Link
tuket
  • 535
  • 5
  • 9

If you programming language supports multiple inheritance, you can inherit from both the Tree and the Warrior and get a TreeWarrior. C++ supports multiple inheritance:

class TreeWarrior : public Warrior, public Tree{
    ...
};

In Java you can't do this since it doesn't support multiple inheritance. The problem with programming languages like JavaScript is that there is no type safety.