Gene Gajewski

Personal Blog

Search
Close this search box.

The latest on my carousel of hobby “things to do” is a C++ programming project. This is an application to query QRZ.com via an XML REST interface to look up amateur radio callsigns. Were it me, I’d do something simpler for a client-server interface, but that is what QRZ.com provides and http REST interfaces are what everyone uses. I am likely a curmudgeon; I still consider http: and XML as a horribly inefficient mechanism for data transfer. Today kids might thrive on the verbosity of html and text, but then they were not around back in the days when we hammered 1s and 0s on clay tablets…

This project is like killing two birds with one stone since programming was once my “hobby” before becoming a career, and amateur radio is another one of my hobbies.

I have not done any C++ programming in years, so this is a bit of self-check to see if I still have it, skills-wise. After a shaky first night, I am happy to say that “Yeah, I can still do this!”. It is all still there for me, and I am all in with C++ templates, containers, algorithms, and the std library. It still amuses me to this day that people consider C++ to be a “difficult” language and prefer to use more modern, garbage-collected languages like JavaScript, Python, and others. Maybe so, but if you become super proficient in C++, you wind up preferring it over other languages, hands down.

Garbage-collected languages automatically manage memory for you, which is a tremendous relief of memory housekeeping tasks for the programmer, but it does introduce a few programming quirks. You have no control of when the garbage collector “decides” to free an item, and if the order in which memory objects are deleted is important (a side effect which is admittedly a corner-case in most of the application types written in garbage-collected languages) you still must plan for it.

With C++, of course you have full control of when and where memory objects are created and freed – it is implicit in the design of the language. C++ will do exactly what the programmer wants. Naturally, it does not have the level of safety a garbage-collected language has, it will allow you to do things that, while legal to do, may cause unintended errors in the application. This is where your knowledge of C++ comes in – you know better than to free the same piece of memory twice; you also know better than to assign allocated memory to a pointer without freeing the memory already assign to it (assuming it was already allocated to begin with). Most of these “rule-of-thumb” ideas come from the “C” language, so if you know that language, those precepts carry over to C++.

So, I am back to using a version of C++ Builder. C++, “C” and I go way, way back. I started out back in the 1980’s with Borland Turbo C version 1.5 (like, ancient history man…). In those days, Turbo C was revolutionary in that it was the only C compiler out there that had an IDE (Integrated Development Environment), let alone affordable by mere mortals and hobbyists. The other choices at the time were Microsoft C, and Lattice C, both products were command-line only compilers.

C++ Builder is a wonderful tool, but it is a bit long-in-the-tooth, and its vendor charges an exorbitant price, even though they do produce a free “community” version (a few versions behind the commercial, paid for version). I am not sure how long C++ Builder will be around in the future.

C++ Builder’s claim to fame is that it provides a full IDE with a PME (Properties, Methods, Events) GUI (Graphical User Interface) builder built in. Still the only one out there for C++, not even Microsoft’s Visual Studio has one for C++ applications. You need to step down to a garbage collected language like C# to have a GUI builder with Visual Studio. The only other C++ GUI builder out there is Qt, often used on Linux platforms, but can be used on Windows as well. Qt is not exactly an integrated solution though; the Qt GUI builder tool is separate from whatever C++ compiler (IDE or not) you are happening to use. It is not exactly integrated into the development environment.

Anyways, I am having a bit of programming fun here. We will see what comes of it.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share the Post: