Posted inExperience / Information Technology

C++ — Never Do’s

No, Never Do isn’t a new loop type though it can be what happens when you ASS-U-ME a default value for a loop variable. These are some things you should never do in your code. I’ve spent nearly 40 years in IT now. For the past decade I’ve been working in the medical device realm. Prior to that I wrote great big boring systems for great big companies. This be what you don’t do in … C++ — Never Do’sRead more

Posted inInformation Technology

C++ – Defaults and Deletes – Pt. 3

In this installment for Defaults and Deletes we finish the code for the example program. So far, among the things you have learned is that the default deconstructor does basically nothing. Near Heap allocations are reclaimed automatically when you return from a method/function. For Far Heap objects all it does is free the allocation. It will not free any sub allocations. You have already been shown the code for the ImplicitClass so we will not … C++ – Defaults and Deletes – Pt. 3Read more

Posted inInformation Technology

C++ – Defaults and Deletes – Pt. 2

Before we go much further with this discussion on Defaults and Deletes, I need you to read the section titled Near Heap in this blog post. It’s a short read with pictures. Then you need to go thank the fools . . . err . . . “learned academics”, cough cough, who re-purposed the word heap to be a binary tree data structure. To understand why things are the way they are, I need you … C++ – Defaults and Deletes – Pt. 2Read more

Posted inInformation Technology

C++ – Defaults and Deletes – Pt. 1

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

Posted inInformation Technology

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