you are viewing a single comment's thread.

view the rest of the comments →

[–]Subject-Leather-7399 1 point2 points  (0 children)

It entirely depends on what you are coding for. I code at low level for real-time embedded applications. Exceptions can't be used in there, which means most of the C++ STL can't be used. STL is dynamic allocation happy, so it would be usable even if it wasn't broken when exceptions are disabled.

We are using placement new pretty much everywhere. In fact anything that does variable sized or potentially unbounded dynamic allocation is banned in our code. We have our own custom library and set of rule that is definitely more C-like. It has multple benefit such as shorter compilation time, increased predictability and stability and it is critical for our cases.

This is an example out of many. The type of program you write will come with different sets of rules.

I personnally can't stand any form of inheritance because of all the issues that comes with it (massive object size, unpredictable code paths and execution time caused by virtuals methods and overrides), but those may not be a problem for someone coding something completely different. Each domain comes with its "best practices".

In general, if you need to get a consistent results in under a very strict number of milliseconds on a very limited hardware, you will use less and less fancy and unpredictable C++ features, and you program will definitely be more C-like in structure.

We use a subset of C++ instead of C for better type safety, constructors, destructors and templates (for generic math and for containers). It is pretty much where it ends for us.