Wednesday, October 14, 2015

A Software Engineer's Hippocratic Oath

I ran across this interesting article by Phillip A. Laplante on the responsibilities of software developers. More than a decade after it was written, many of Laplante's ideas and observations still ring true.

Here's his proposed version of the Hippocratic oath for software engineers. Even if it never becomes a part of the sacred and occult investment rites1 which every developer must undergo, it contains a lot of truth.
I solemnly pledge, first, to do no harm to the software entrusted to me; to not knowingly adopt any harmful practice, nor to adopt any practice or tool that I do not fully understand. With fervor, I promise to abstain from whatever is deleterious and mischievous. I will do all in my power to expand my skills and understanding, and will maintain and elevate the standard of my profession. With loyalty will I endeavor to aid the stakeholders, to hold in confidence all information that comes to my knowledge in the practice of my calling, and to devote myself to the welfare of the project committed to my care.
I especially like the idea of developer as a steward of things that have been entrusted to her for a time. After all, isn't that what most of our lives are about anyway?

1 Which I just now realized I probably shouldn't have even mentioned in so public a forum as this here Internet Web Log is. Whoops! Sorry, Programmer Illuminati.

Thursday, October 1, 2015

Error Creating Form: Ancestor for 'TFormName' Not Found

So, this one has been bugging me for a while. I'm using Embarcadero's RAD Studio 10 Seattle, working on a sizable C++ application. For a few specific units, whenever I load them, I get the following message:
Error creating form: Ancestor for 'TFormName' not found.
(Of course, it actually said the name of my form, not 'TFormName'.)

And when this happens, my .dfm (Delphi Form) won't load, so I can't do anything with the design of that particular form. To work around this, I had to open the ancestor (or in at least one case, multiple ancestors), and leave them open in the IDE, before being able to view my form's .dfm at all.

So I double-checked all my include and lib paths, as well as my include statements in the headers of my .h files. I googled my fingers to the bone, looking for any answer I could find. Nothing.

Finally, I noticed that the form I was trying to inherit from wasn't even in the inheritable items list, which led me to this old post, and I knew I'd found the culprit.

In the end, the solution was spectacularly simple: Remove all problematic units from the project. Then, add them back in the appropriate order. No more error!

It really was as simple as this: