Back when I was a lowly junior programmer, life was great. We had a humongous 64k of memory to play with, two whole (user defined!) colours and an 80 character width screen. We managed gigantic millions of member pension schemes using the equivalent of a commodore 64. Recursive functions meant stack overflow. Not one of these modern day programming problems you see Over There, but an honest to goodness actual stackoverflow.
My first job was programming pensions systems in UCSD P-System Pascal, which holds the honour of being not only one of the forefathers of Object Pascal/Delphi, but also of Java. It was virtual machine based and you could write it once, and run it anywhere. It supported pointers and all that lower-end of high-level jazz. Check the wiki, learn your history.
At the time, the company I was working for were writing a new version. They looked at the 40 or so coders they had, decided they all knew pascal, that Delphi was a good fit and started building the future. They’re still using it, and so are a lot of other Very Important Software Projects around the world. Delphi makes it easy and quick to throw up a desktop database app, so what’s not to like?
It’s awful to work with and difficult to maintain.
Nothing has changed in Delphi land for 10 years, maybe more. Sure, there’s new versions, sure it’ll now compile to mobile code but at it’s heart it’s still a tool for producing horrible code and bad un-maintainable architectures it always was. Lots of the code is auto generated with things coupled so tightly you may as well use superglue. Things are half visual, half code and always bloody hard to find. The concept of design patterns seems to have passed by unnoticed. Want a 30 line auto-generated SQL statement? Use Delphi. Want to change implementations, refactor your code or sign your XML? HA HA HA HA. Nobody does that.
It’s not all bad!
That said, I may be being a bit harsh. It really does deliver on the promise of making it easy to throw together simple applications.
Patterns like MVVM and techniques like Dependency Injection and Unit testing do seem to be used in the world of Delphi. There are open source DI containers, MVC and REST frameworks if you look hard enough, although documentation is pretty woeful. There’s also a unit testing framework baked right into the core IDE. There are some nice videos by Nick Hodges. Here he’s showing how to make a MVVM Delphi app on youtube and he has others on Unit testing and DI. The video is also a great introduction to how delphi works.
Why do I bring this up?
Joy of joys I may well be working with Delphi in the near future.
I’ve got the IDE on my laptop and I’m getting my head around it now. I’m building a REST server to try it out, which in Delphi speak means generating a form with a “Go” button and exposing all of a classes methods via HTTP in a /classname/methodname/parameter1/parameter2 RPC style. I think I’m going to have to rewrite the URLs via Apache, but whatever. I’ll update you as I go.