I haven’t nailed down a favorite AI yet. Copilot’s at the bottom of my list—it churns out the worst Delphi code and gives answers so short they’re borderline useless. Grok’s been the frontrunner so far, based on my own tinkering. I had subscriptions to Google’s AI and to ChatGPT and Copilot.
In some video presentations from Embarcadero, several people said that Devin is the best for Delphi code, but that is not free to try. I will buy a subscription to try it.
Where AI sucks
AI’s got some serious weak spots, especially for a Delphi dev like me:
- Big Code Chunks? Nope – I don’t bother using AI to generate large pieces of code. Writing the prompt takes forever, and then I’m stuck trying to understand the code it spits out. Right now, AI still hallucinates sometimes but I am sure the future versions will clean up their act as accuracy improves. I guess queering the AI via API helps since you can control the temperature and other similar parameters (P and K).
- FMX Flops – Don’t even try getting AI to whip up proper FMX code—it hallucinates A LOT! Probably not enough training data.
- Large Projects = Chaos – I fed an old project (not mine) to the AI to modernize it. It rewrote tons of code, but when stuff broke, I was lost. Had to keep tossing it back to the AI to fix because I was too lazy to grok the whole thing myself. Ended up “vibe coding” for hours—debugging without a clue. Total time sink.
If you have a large project, don’t rely on AI. Read it thoroughly and understand it and send to the AI only small chunks of code to rewrite! - IDE Integration Disappoints – IDE integration I find the AI functionality in Delphi 12 IDE too basic (and it works with a paid subscription only), so I would rather use the web interface. I open a feature request here: https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-3689
- Complex Business Logic – AI chokes when it comes to deep business logic. If you need to write a method in a class, then you need to send the AI the whole class and other classes related to that class and data types and maybe input data… in other words you need to send to the AI all the code that the AI needs in order to understand the context. The free AI might truncate your uploaded PAS files, while the paid AI just gobble tokens like candy.
Where it shines
AI’s not all bad. Here’s where it actually pulls its weight:
- Small, Standalone Functions – It’s ace at cranking out little context-free utilities—like “write me a function to strip punctuation from text.” Need a method inside a class? You’ve got to shove the whole class at it. Free AIs might chop your input off mid-sentence; paid ones just gobble tokens like candy.
- Bug Hunting – It’s got a knack for sniffing out bugs in my code. Saves me some headaches there.
- Text Polish – AI can spruce up text for me—handy for my books. Usually, I write down everything I think I need to write, then I ask the AI to improve the text. I specifucally ask it to retain my style and not to change my text too much.
- Unit Test Generation – AI is quite good at this.
- Code upgrade – I used the AI to help me convert 32 bit code to 64. Be aware: you cannot fully rely on AI for this. You really need to understand what you are doing. Bugs generated by invalid 32 bit pointer typecasts can be very difficult to track down. Try to do the conversion on yourself then explain to the AI what you have done and let the AI check on you.
Note that after doing a lot of these conversions during the years, I wrote a quite complete program (open source) that you can help you upgrade an old Delphi 3 project to Delphi 13. Actually, it does much more than just 32 to 64 bit conversion.
Corporate use
For personal stuff, I’m leaning hard into AI now while it’s cheap or free (and still rough around the edges). Once it gets polished, prices are gonna skyrocket—those trillion-dollar AI investments aren’t charity. Companies will want their cash back, plus a fat profit. So, expect the prices to get much higher as the AI gets better and some of the many (too many) competitors will fail and competition will die out.
For corporate use, local AI’s the way to go. It’s free, keeps your data private, and I see huge potential in it scouring all your code for bugs automatically. You could even fine-tune it on your own codebase to make it sharper for your projects. But it’s not all pink—setup’s a pain, maintenance is a grind, and you miss out on slick features like agents. Still, for privacy and cost, it’s hard to beat.