Nitish Singh
Apr 24, 2024

--

I completely agree that C++ supports multiple inheritance, enabling a class to inherit from multiple base classes and eliminating the need for the distinction seen in C# and Java.

Exploring interface-like behavior in C++ can be educational and beneficial for defining clear contracts in projects. I am also with you on this, that this is equivalent interface of C#/Java and not 'interface of C++'.

For me multiple inheritance seems like a really bad idea. What's your take on this?

Additionally, while not mandatory, I always advocate to include the 'virtual' keyword when overriding a method, just for enhancing code clarity.

Are we in agreement on these points, or do we still have differing opinions?

--

--

Nitish Singh
Nitish Singh

Written by Nitish Singh

Passionate about empowering devs with practical tips, using modern C++ as the tool, and up-to-date knowledge. Join me on Medium for engaging articles.

Responses (1)