mÄndag 7 juli 2025

What AI is best to help with Delphi coding ?

 Today there are many AI frameworks available and things change fast.

I made a test to see what AI is best to help me write a complete nontrivial application from scratch.

My prompt is

An Advanced File Manager with Image Viewer:

I'd like you to create a Delphi VCL application that functions as an advanced file manager with an integrated image viewer. The program should only use standard components.

Choose layout and deliver ready to run source with dpr, dfm and pas-files

Basic Functionality:
File Browser: The program should display a tree view of the file system on the left (similar to Windows Explorer) and a list of files and folders in the selected directory on the right. The user should be able to navigate through the file system.

Image Preview:
When an image file (e.g., JPG, PNG, BMP) is selected in the file list, a preview of the image should appear in a separate area of the program.

File Operations: The ability to copy, cut, paste, rename, and delete files and folders directly from within the program. A confirmation dialog should appear when deleting.


The comparison is not entirely fair. I have a paid account on Google Gemini and Microsoft Copilot through work. Accounts on ChatGPT, Claude and DeepSeek are free.


My first attempt was Gemini.

It generates 3 files. FileManager.dpr, Unit1.pas and unit1.dfm.
The errors

1. Missing uses, VCL.Menus

2. DirectoryTreeView.Clear; should be DirectoryTreeView.Items.Clear;

3. FileListView.OnItemChange does not exists


When fixed the program starts but was unstable and raised exceptions when change active line


Next attempt was with Microsoft copilot M365

It generated a zip-file with source but I could not open it.

When I ask to not archive the files I could open them in Delphi

AdvancedFileManager.dpr, MainFormUnit.dfm and MainFormUnit.pas.

And it compiled and works when starting the app. At least partially.

exception "Unknown picture file extension" was raised when I clicked on any file that was not an image.



ChatGPT

This is the AI that started all the hype.

But when I asked for Delphi VCL application all went wrong and it generated python code???

So this case was aborted.



Claude

I only have a free account and ChatGPT was the only model available.

When I tried it it generated some Delphi code but dfm code was not complete.
So this was also aborted


DeepSeek

This AI start generate delphi code. But when generate dfm it was stuck generate bitmap for imagelist. It keeps generate zeroes. At the end I aborted it.



So the winner of this contest is.... M365 Copilot. đŸ˜Š
It manage to make a skeleton for a working Filemanager at first attempt.
The exceptions is easy to fix by add a check for filetype.

Download source generated with Copilot

EDIT:
Now I got source from prompt above generated by Claude from 

Sergio H Guerrero R. 


Thanks a lot.
The source compile and run without error.
Actually nothing happen as logical drives array was not Delphi strings.
But after that was fixed it looks good.

So just want to say that I can recommend Claude for Delphi AI but it is not free.