Skip to main content
Thoughts from David Cornelius

Software development tools and techniques explored--mostly Delphi

Delphi Debates: Assigned

Category

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.

Delphi Debates: FreeAndNil

Category

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.

Delphi's Find in Files Trick

Category

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?

There is!

Switching From UniDAC to FireDAC

Category

Since upgrading my Delphi subscription from Professional to Enterprise, I've been slowly replacing third-party database components with FireDAC since the Enterprise edition comes with many more databases supported. One of the ones I've used a lot is Devart's UniDAC. UniDAC is a great database component suite. I've used them for many years, they have an excellent support forum, and frequent updates. I just don't want to pay for duplicate functionality--well, mostly duplicate; there are some advantages to using UniDAC but they're not deal-breakers for me.

Application Usage Reporting with Delphi and PHP

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.

My History with Delphi--and Why I still Use It

Category

Today marks the 27th anniversary of the first release of Delphi. My personal experience with the product starts several years before 1995 and ends with the conclusion that Delphi is still just as relevant and critical to my business as ever. Let me tell you the story about how I came to use it--and why I still find it the best development tool for what I do today.

Delphi Productivity Tips: Keyboard and Mouse Basics

Category

There's an old story about a question that was posed during a family meal asking what was the best modern convenience in the home. The younger generation were saying things like ice makers in refrigerators and microwave ovens. The grandmother of the family listened for awhile then gave her input: indoor plumbing! It's too easy to take some of the basic conveniences of life--or features of an IDE--for granted, and assume they will always be present. This article continues a set of Delphi Productivity Tips but goes back to some of the basics of the Delphi IDE that I realized are probably more import--but I don't always think about because I figured every development environment should have.

TRESTResponseDataSetAdapter and Hidden Gems of the REST Debugger

Category

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.

I Wrote a Book!

Early last year, I was contacted by Packt Publishing with a request to write a book about Delphi. I was surprised, honored, and a little scared! I know the Delphi community is world-wide but does not have as large a following as other languages so was unsure how much of an audience there would be. Was I up to the task?

Delphi Productivity Tips: Navigation Toolbar

Category

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.

GetIt Dependencies Work!

Category

When GetIt Package Project Dependencies first came out in Delphi 10.1 Berlin, they didn't work right, or at least not for me in the way I expected them. I had problems with them in Delphi 10.2 and 10.3 as well. I don't remember if I tried them or not in Delphi 10.4. However, with the new Delphi 11 Alexandria that was released last week, they DO work!

RAD Studio 11 Alexandria - First Look

Category

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.

 

Desktop UX - How I Escaped Cluttered TabControls

Category

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.

Delphi Productivity Tips: Live Templates

Category

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.

Loading a File into Advantage Database

Category

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.

Delphi Productivity Tips: Built-in Shortcuts

Category

I've been watching a weekly webinar by Embarcadero, usually hosted by Jim McKeeth, called TCoffeeAndCode and today's topic was "Managing Large Projects and IDE Performance Enhancements". This one was packed full of tips and tricks for speeding up your development with IDE plugins, better use of the keyboard, managing projects, analyzing code, and so forth. Near the end, Jim called out to programmers everywhere to blog about their favorite productivity tips and share with others what works for them to speed up software development.

So I'm taking on this challenge for myself and am starting a mini series highlighting ways I use Delphi, the short-cuts I've found useful, my favorite plugins, and other tidbits I've picked up along the way. Perhaps you will find something useful. In this first blog on the topic, I'll talk about the built-in keyboard shortcuts Delphi provides in the editor and how I use them every day.

Accidental Hack

Category

One of the legacy projects I support was written in Delphi 7 and uses ACE Reporter. I have only used ACE Reporter once before and very little even then so don't know much about it but it seemed to work fine for what it was doing. I was tasked with adding a column to a report where the data on the report came from a temporary table that gets filled every time it prints. Adding a column to the report implied adding a column to the table. A previous experience updating tables with this app proved to take an inordinate amount of time so I wanted to avoid that if possible.

RAD Server Encrypted my Database! Or did it?

Category

I've been using a couple of small InterBase databases for testing and learning purposes while doing some mobile and web development. I have a Windows 2016 Server in my office with InterBase XE7 and 2017 installed using different ports. Since I work from multiple virtual machines and sometimes a laptop, I just put the databases on the Windows server to access them all from whichever development environment I happen to be using. Both InterBase instances on the server were using the Developer license that comes with Delphi--requiring a restart once a day.

Automating Git Commit Signing

Category

A few days ago, I wrote about signing your commits so they'll show up on GitHub as verified. After that process is in place, every commit requires the passphrase associated with the signing key to be re-entered. This gets old quickly if you're committing frequently (which you should). Fortunately, there's a way to cache the passphrase to make this much less burdensome. Unfortunately, the cache only lasts 10 minutes.

Subscribe to Programming