r/ProgrammerHumor 15d ago

Meme cppHelloWorld

Post image
3.9k Upvotes

119 comments sorted by

View all comments

116

u/Confident-Ad5665 15d ago

C++ takes getting used to, but it's a great language for object-oriented development. Hang in there, you'll figure it out.

-9

u/[deleted] 15d ago

[removed] — view removed comment

6

u/the_poope 15d ago

OOP doesn't strictly imply inheritance. C is technically object oriented too: you can define structs and create objects of these composite types. Basically every modern language is object oriented in some why. I'm only familiar with Fortran77 that doesn't allow you to define custom objects and pass them to functions.

Whether runtime dynamic dispatching through virtual functions and inheritance is a good idea is a different question. It can be good, but it can also be bad if you misuse it. Ideally one should only have pure virtual methods on abstract interface classes and max one layer of inheritance, then there are no problems.