Object Oriented Programming really an Advantage

You "recompile" once and then the program runs 10x or 100x faster than Java.
Indeed. And no risk of a user coming back to you citing an error from "${INCOMPATIBLE_JRE}"

Backwards / forwards compatibility is a little bit of a minefield with the large Java VM's that ultimately run the bytecode. I guess it all starts here.

(What many tend to do is stick to LTS versions of the JRE and recompile everything every ~5 years)
 
The problem with OO isn't OO but how even not so average programmers treat it.

I've seen an open source 3D engine that used C++ OO hierarchy and patterns for its internal model. When you have to look up a float through the shitstorm of class hierarchy performance goes out of the window. The same engine had a major internal rewrite for next version, where this was simply dropped in favour of primitive objects such as pointer arrays and C style structs.

C++ still has some syntatic advantage over OO style C mainly the coupling of 'methods' inside a struct and 'this' keyword.
If such thing was in C it would shorthand a lot of code.

Besides OO is just one part of classic C++ which is not that friendly, operator overloads and RAII can be huge pitfalls too. The prologue and epilogue of some scope can drastically increase based on perhaps invisible constructor/destructor of some class. You can make class int with + operator overload that does "rm -rf ~" in the impl. 2+2 = files gone.

The concept of "Embedded C++" largely comes down to throwing away features that have expensive or complicated consequences from C++ and it is actually a good thing for desktop programming too.
 
C++20 Modules now have visibility vs reachability issues, causing significant challenges/complexities, for developers and especially for make/build tools.

C++ templates are either recompiled wherever used of if instantiated to provide an API, then C++ yield the same code duplication that C would, only at least in C, one has control over using CPU techniques to share common code for void*, various integer sizes, simple struct small structs, and perhaps even floats in some cases.

C++ may be like playing tennis with a baseball bat. Yes, you can hit a winner shot but with significant tool complexity and caution required, whereas with C and a bit of lower-level understanding, you can play with finesse and complete control. The knowledge required to control the plethora of knobs with C++ is probably significantly more at this point than the bit of CPU, memory, and hardware knowledge required to code in C and with memory safety. Not to mention compile performance for C is much better! Plus C23 and C2Y provide excellent features. C++ also does have some useful features, e.g. C++20 concepts, but again, the list of scenarios/syntax to avoid in C++ is long indeed.

Overall, OOP as a paradigm can be fine, but as a syntax it must be logically consistent and simply a different but helpful presentation of functional programming. Some OOP languages are better at that than others. Ultimately, functions are the core conceptual foundation, and I view OOP as a presentation layer that can simplify use of datasets with functions and reduce boilerplate.
 
The concept of "Embedded C++" largely comes down to throwing away features that have expensive or complicated consequences from C++ and it is actually a good thing for desktop programming too.
Yes, basically anything that results in the use of a vtable (e.g. inheritance), is generally best avoided.
 
Back
Top