Skip to main content
Thoughts from David Cornelius

Category

If you only use one version of Delphi, your life is fairly simple when it comes to writing the next great app. But sooner or later, you're going to want a second machine or you'll have to upgrade your hardware or a new version of Delphi will come out and you'll want to take advantage of the new features. After a few years, perhaps you'll be in charge of several projects, some of which may get "stuck" in a version of Delphi because a third-party component wasn't updated or because the project is in maintenance mode and there's no reason to put out the effort to update it.

After two decades of this, you may find yourself in my shoes, supporting projects in no less than seven different versions of Delphi: from plugins in Delphi 5 for an old point-of-sale application, to legacy applications in Delphi 7 and XE I've inherited from retiring consultants, to a project I support in Delphi 10.1 Berlin, and now new ones being migrated from 10.4 Sydney to 11 Alexandria.

How do you keep organized? I use the following techniques for consistency.

Color Themes

Programming in an IDE is somewhat like driving a car. You need to know where the controls are, how the brakes feel, and how sharp to turn the wheel to drive it well and to be able to quickly react to various situations. If you have two vehicles and put in any time into them, you can get familiar with both even though controls will be in different places. In our family, I have a truck and my wife has a small car. I drive my truck most of the time but have driven her car enough that I can quickly adjust to a different set of muscle memories. What triggers the familiarity? What you see on the dashboard, how the car smells, and how the seat fits.

I use similar constructs to keep the different versions of Delphi familiar using a great open-source package called Delphi IDE Theme Editor. I use specific themes for specific versions of Delphi.

Twenty years ago, when I was working with Delphi 5 almost exclusively, I got very familiar with its classic color scheme that had come from it's predecessors dating back to the early 1990s with Borland Pascal. When I see that blue background and the Lucida Console font, I'm in the driver's seat of Delphi 5, I use a slightly smaller set of hotkeys, I know what libraries to use, and what things I have to do differently to manage a project. Similarly, Delphi XE is always set to use the "vibrant-ink_modv2" theme; it's color scheme and font selection are instantly associated with two long-term projects I support, while the dark theme of Delphi 10.4 Sydney and 11 Alexandria are what I use with cross-platform development.

I keep a list of which themes I use for which versions of Delphi so that when I set up a new laptop or virtual machine and am installing Delphi, I also install the Delphi IDE Theme Editor and I look at my list to set up a consistent theme to help feed all the nuances of that Delphi environment in which I'm working to my sub-conscious. It's not 100% fool-proof and there are times I hit an invalid hotkey or include a unavailable unit, but I know it helps me a lot.

Project Paths

Another problem with working on so many diverse projects is that I have multiple working environments. I support projects utilizing at least five different databases, some cross-platform apps, some old apps, a few with a huge set of third-party components that create conflict when installed simultaneously with others. There are subtle differences in where and how Delphi is installed and how many hard disks there are. So to keep my sanity when loading a project, I set up a consistent root path on each Windows development machine.

I've learned it's not a good idea to keep data on the same drive as your operating system, so I don't want to use C:. There are often multiple drives installed, so D:, E:, F: and sometimes a few more are off limits. In the early days of NetWare networking, we'd often count down from Z: to map network share drives. I finally chose: drive V: as the drive I consistently use on every development machine. Whether it's a physical drive, a VHD (virtual hard disk), or simply a mapped drive set at system startup, I always place projects in sub-folders of drive V, wherever drive V points to on that particular computer.

My main development machine has multiple hard disks and I put all my development on the physical drive E, so I use the subst command to provide a drive V for development. On my laptop, I created a VHD and assigned it drive V so there's a physical portion of the drive allocated for development.

Synchronized Code Templates

Code Templates are one of my favorite productivity features of Delphi. I've standardized on the ones I use most for many years now but every once in a while, I'll modify one. When that happens, I want to not only make sure it's backed up but also be able to use it in other Delphi environments as well. The standard place for user-defined Code Templates is in C:\Users\[USER]\Documents\Embarcadero\Studio\code_templates which means that multiple versions of Delphi on the same machine will all have access to the same templates--and if you're backing up your "Documents" folder, then they're already backed up.

To get them to a different machine, you can manually copy them but there are so many free or low-cost file-syncing utilities, it makes sense to utilize these to keep the code templates automatically updated across all installations. OneDrive and DropBox are well known ones that provide continual file synchronizing in the background--your favorite backup program may have one as well. There's one down-side to using many of these, though: the synced folders usually have to be under a root folder watched by the synchronizing service. But with your programming skills and knowledge of command-line utilities like mklink, those folders can be anywhere!

Synchronized Bookmarks

Another thing that's nice to have around is a favorite collection of website bookmarks. Now if you work with multiple virtual machines on one machine, it's just as easy to use one web browser from the main desktop to do your research but sometimes it's nice to have that link right within the environment you're working. When you're on a laptop away from your main machine, it's even more important to have those saved bookmarks available so you don't have to look them up again.

I use several different web browsers for different purposes, not only for testing web apps but to keep different types of research or communication organized. I use the Brave browser just for development and have quite a few saved links to blogs, GitHub repositories, add-on tools and libraries, and general information articles that are useful for programming. Most browsers require you to create an account, then login to that account from different machines in order to synchronize settings. But in Brave, it generates a "Sync Chain Code" which for me was 24 random words. When I enter those words into a different installation of Brave, I get all my settings synchronized! It even tells you how many devices you've synchronized with and when that device was last active.

Environment Consistency for Productivity

These tricks have become invaluable aids to keeping my sanity and help ensure high productivity when the need to switch projects and environments comes around.

Fronzel Neekburm (not verified) Tue, 01/18/2022 - 09:47

I only have my Delphi installation on virtual machines. One VM for 11.0 Alexandria, one for 10.4, one for 10.0 and so on. Keeps everything properly separated from each other and I can just take them with me and use the VM on another computer or host it on some company server.

david Tue, 01/18/2022 - 16:15

In reply to by Fronzel Neekburm (not verified)

I use VMs a lot as well and they work great for keeping things separate. Sometimes, I work on my laptop from a different location than my main desktop so it's nice to pull up Delphi on a different machine and see the same color scheme and path structure.

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
Please enter the characters shown; no spaces but it is case-sensitive.
Image CAPTCHA
Enter the characters shown in the image.