Jorge Ortiz’s Post

View profile for Jorge Ortiz, graphic

Radar Analyst and Systems Engineer

I think a big issue is the overuse of OOP principles as a solution to all problems. Many a time if I have seen code bases where abstraction and encapsulating even the most minute of things are everywhere, making implementation and maintenance a nightmare. I like John Carmack's statement that he uses "C-flavored C++", which was sort of the whole point of C++ being thought of as "C with classes". I personally as well as others I have worked with, have had success following a few principles that attempt to use the best (and avoid the worst) of both: Use classes only when appropriate, avoid inheritance if possible, avoid polymorphism if possible, lean on STL to handle common data structures and operations on them (e.g., <vector> and <algorithm>, and judicious use of references over pointers. To go against any of the above, or use additional features, a REALLY good reason was needed. All of the new stuff like smart pointers, constexpr, lambdas, etc. is more fluff and adds bloat, along with the accompanying headaches. Then again, my field of work has biased my view on how C++ should be used.

View profile for Jelle Bakker, graphic

Senior JUCE Developer

C++ is powerful, but modern C++ can be very overwhelming... This article on refactoring legacy code (see link below) shows how a Circle class with just a constructor, a pi member, and a few functions, clean, readable, and easy to understand can be turned into a complicated, difficult to read Circle class containing a massive amount of modern C++ features like constexpr, explicit, auto, inline, templates, type traits, rvalue references, noexcept, and user-defined literals. I follow every decision made and I do understand that the Circle is technically improved, but if feels bloated and complex. How can we balance simplicity with the features of modern C++, or is it possible to achieve both? https://lnkd.in/ePKsNCVB #cprogramming #moderncpp #keepitsimple

  • No alternative text description for this image
Christopher Sandy

Principal Signal Processing/Systems Engineer at Raytheon Technologies

2mo

Truth. OOP 101 gets you most of the way there most of the time

To view or add a comment, sign in

Explore topics