Defaults and Deletes tend to be needlessly confusing for new C++ developers. Trying to learn this topic is why so many put on a diaper and go code Python. Hopefully this example series and discussion will allow you to man up. This is a continuation of my C++ series to assist junior/new developers so they can do something meaningful with their lives. No, you can’t use Python for a medical device. Remember: In the real … C++ – Defaults and Deletes – Pt. 1Read more
C++
C++ — That Const Thing
Const is what makes C++ great. Const is what makes C++ too horrible to work with. Developers who read those “Effective” books on C++ really screw the pooch. The developers working on the Qt library who hide everything anyone would want to override inside a “private” class only documented in the source file for the actual class and buried behind a macro passing most everything to it as const make the “screw the pooch” developers … C++ — That Const ThingRead more
C++ Initialization and Constructors Explanation
While many of the tools I and other developers use making medical devices require C++17 much of the code we write is C++11. Usually this is mandated by the shop. There are good reasons for sticking with C++11. It is easier to change out a library, especially if another project has already vetted that version of the library with the FDA, than it is to change the coding standard of an existing device. Instead of … C++ Initialization and Constructors ExplanationRead more
std::optional Example and Explanation
std::optional is an attempt by the academics on the C++ standards committee to “fix” what they believe to be abhorrent behavior. As usual they created a committee quality result. To understand my disgust with what they created you have to understand that I’ve been programming on real computers since the early 1980s. Even then VAX BASIC had OPTIONAL and a much better implementation for OPTIONAL parameters. You can read more about it in this book. … std::optional Example and ExplanationRead more
C++ std::string_view Example
If you work in IT long enough you will learn that academics have overrun standards committees. std::string_view is an example of why an elephant is a mouse designed by academic committee. For certain there were good intentions behind this. Too many of you kids unwilling to go to college and take all of those hard classes to learn how to do things right were living via the “just throw code at it” mantra. To get … C++ std::string_view ExampleRead more