Early in my career, I was studying the code of an application written for the Apple II in preparation for developing something similar on the PC and would often ask questions of the original programmer. Most of the time, I'd get valuable information about the purpose of a routine or why something was done a particular way. But every once in a while, when pressed for an explanation, the programmer would think for a minute, then simply utter, "For Historical Purposes" and walk away chuckling.
This time of year in the United States is marked by a major holiday, Thanksgiving, the last Thursday of November. It is during this time that ad campaigns, religious organizations, and families everywhere tend to step up their recognition of everything they're thankful for. As a software developer, I'd like to hook into this theme and highlight features of programming tools I use that make my life better--most notably, Delphi--and create my own "thankfulness" list.
Nearly two years ago, Idera acquired apilayer, a collection of various cloud-based APIs. Idera being Embarcadero's parent company (and Embarcadero being the publisher of my favorite development tool, Delphi), I was interested to see what this was all about and looked at the handful of APIs available. One caught my eye and I made a note to come back and check it out more when the time was right.
The Delphi Debate series continues with another topic that has been discussed back and forth for ages. This time, instead of a procedure or function in the RTL, we are talking about three reserved words: the with, goto, and label statements which pre-date Delphi--they are part of the core Pascal language itself!
As a Delphi MVP, I was surveyed on my stance of the use of
FreeAndNil. In that questionnaire was included a question about the use of
Assigned(). Really? Is that debated as well? I couldn't find anything on the internet debating this except for an old discussion on StackOverflow. I use this function frequently and as I looked more deeply at what it does, I'm even more confident of its use.
When freeing an object in Delphi, simply calling its
Free method calls the object's
destructor and releases the memory allocated to the instance of the object. But it doesn't change the address of the referencing variable which, therefore, still points to the place in memory where the object existed. The released memory can be quickly reused by other objects or resources and if you try to access the object again without re-creating it, you could get an Access Violation or some other error or worse yet, unpredictable behavior.
You've probably used Delphi's Find in Files feature to search for an identifier or library function through multiple folders of source code. If you have backups of your source or multiple projects with copied or similar sets of routines and check the "Include subdirectories" checkbox, the search results could contain a lot of duplicates taking extra time to wade through them all. Wouldn't it be nice if there was a way to fine-tune the folders being searched?
In my last blog entry, I explained how I converted my original company logo in JPG format to SVG. That's sort-of like reverse-engineering to get the source code. Now that I have my logo in SVG format, I can more easily manipulate it and create custom derivations for specific purposes.
I do a lot of contract programming in a niche market that requires small, custom-written, import/export programs. Some of these can are copied with few modifications for similar customers. Once in a while, there's a common need where the application can be used by several customers. In those instances, I need to implement some form of licensing and accountability but I didn't want anything too elaborate nor do I want to incur ongoing charges for an online API for the one-time pricing structure of the projects I work on.
Writing REST applications in Delphi is pretty simple with the advanced components we have available these days. The functionality encapsulated allows us to spend time on the business and user interface aspects of development rather than the nuances of connecting to an API and parsing JSON results. When starting a new REST app, I usually use the REST Debugger that comes in RAD Studio to test out an API before building the app itself. There are other REST API tools but this one has a great feature that saves me time building my Delphi app that no other tool has.
At the top of Delphi's code editor, is a Navigation Toolbar with several "jump lists" as I like to call them. They help you find and jump to places in your code quickly by selecting them from lists built by the parsing engine in Delphi. There are also shortcut keys that allow you to use them without taking your hands off the keyboard to use the mouse.
RAD Studio 11 Alexandria was released Thursday. There were webinars, blog posts, and tweets about the many wonderful things in the latest major release of Delphi and C++Builder from Embarcadero. These include High-DPI support in the IDE, design-time style viewing in VCL applications, support for Windows 11, ARM-64 compilation on Apple's new M1 chip, and many other features and enhancements. I installed the update and did a little bit of coding to get a feel for how well it behaves and am quite pleased. I'll be using it more over the next several days and weeks as I shift my development, install plugins and components, and tweak the settings to tune my new work environment. Here are just a few things I noticed right away.
This week's Desktop First UX Summit, hosted by Embarcadero, is a great collection of presentations by leading software development and design professionals sharing the theory and practice of creating great desktop experiences. I really appreciate the focus on desktop app design--not everything is mobile or web. One of my favorite speakers every year is Ray Konopka and he gave another great talk, this year on How Tab Controls Can Ruin Desktop UX.
A long time ago when Delphi 5 was king and conferences were in person, I was able to attend BorCon and saw a session presented by Mark Miller. I don't remember the topic but I do remember noticing that he was typing code really fast. He wasn't just typing fast, though, he was coding fast! As he was typing, characters were being turned into words and sometimes even full expressions. At some point, he explained how he was doing it: he was using a Delphi IDE plugin called CodeRush.
I switch back and forth between doing cool new stuff with the latest version of Delphi on web and mobile platforms and supporting legacy apps that have been running for a long time but the original programmer has long since left. The project I'm working on today falls into the latter category and the current challenge is storing a letter template file in an old Advantage Database. My update to the software has be put into an installer script and sent out to non-technical customers to update their existing installed databases.