Wednesday, July 6, 2011

The Things I love About Delphi

Disclosure: At the time I wrote this, I was working for Embarcadero, but not on the Delphi/RADStudio team. I do not get paid money to say nice things about Delphi, but whether I did, or I didn't, I would say nice things about Delphi anyways. I no longer work at Embarcadero, and I still don't get paid to say nice things about Delphi, and I still think it's the best language/IDE/tool in the universe.

When I started learning programming, I was using a Commodore 64. I never stopped learning. I learned C/C++, I learned Python. I learned Objective-C. I learned a bit of Java. I learned some Smalltalk. If you love programming, you love continuous learning. I have a particular habit of learning new languages. But I always come back to Delphi when its time to Get Stuff Done.

While using Delphi every day I still learn something new every day. Sometimes, it pays to go deep in your learning, especially with Delphi. If I could always learn without getting tired, without getting frustrated, and without getting sometimes a little teensy weensy bit angry, I would be a better programmer, but I would be somewhat less human.

Because I am a mere mortal, a human being, I prefer Delphi to everything else I have ever used, because it is a programming environment created by, and for human who want the following things:

1. Quick, if not instant, results. I don't want to wait all day for a build.

2. Little or no accidental complexity. Accidental complexity is most simply defined by me, in laymans terms as "crazy crap that you shouldn't have to do, and that renders a system unfit for use by humans".

3. I want to write an application that runs well on Windows.

If you have ever tried to write a Windows application, you will see that you have a lot of choices. So why choose Delphi? Every programming language or tool choice introduce tradeoffs, and complexities. Remember in my previous post, where I said that "when all you have is a hammer, everything looks like a nail". Well, Delphi is the best hammer out there, if your nail is "write an app on windows".

If you only wanted to write an application for Windows, and you wanted it to just work, and not require any runtimes or complex installation scripts just to get it to run on someone else's PC, running any version of Windows since Windows 2000, then Delphi is the very best thing ever. If you wanted to target Windows 98 at this late date, you still could, but you would have to use Delphi 7 or 2007, not Delphi 2009 or later. Delphi requires no runtimes. Delphi runs fast. Building apps in Delphi is easy. Complex user interface requirements can be cut down to "done" by addition of some components. The language is powerful, and you can build amazing stable codebases in Delphi, unit test them, and work in a very fast "agile" RAD method, and build great things, in Delphi.

You can also use Delphi to build spectacular piles of Crap. I would like to humbly confess that not every application that I have ever written in Delphi is an application I am proud of. Some of them have been crap. But I learn from those mistakes, and each time I make different ones, and the results are (hopefully) better and better each time. I fully believe in object-oriented programming, and I fully believe in unit-testing. I believe in self-improvement and personal growth, as a developer. Never, ever, has Delphi held me back. If you started today learning to write Windows applications in C#, or Java applications, you will hit walls, at some points, walls that for me, Delphi Code Monkey do not exist.

Here's what I get out of Delphi that I don't get anywhere else:

1. Complete a RAD workflow. I will give a demo of what a complete RAD workflow is, in a subsequent demo. If you have ever used Delphi or Visual Basic 6, you know what a complete RAD workflow is.

2. Flow Mode. Flow mode is about freedom from distractions. If you are driving your car and you are thinking about driving the car, thinking about where they put the darn gear-shift, and how exactly you're going to manage to park this thing, then you are not in flow mode. If however, you and the machine are one, then you are in flow mode. Flow mode requires the "RAD workflow" above. Flow mode also proceeds from the beauty of the Delphi Object Pascal language, which I will write about later.

3. Platform Fit, without the Fat, while minimizing External Runtime Dependencies. "Running Light without Overbyte" was the old tagline from the venerable "Doctor Dobbs Journal". I like to write apps that belong on Windows, that look right on windows, and perform properly on windows, and which install without any trouble on windows, and which (seemingly paradoxically) have almost no dependencies on additional Windows technologies, especially not flaky ones like MSXML, WinInet, Internet Explorer embedded views (SHDocVw), etc. I will write a separate blog post about this "work on Windows, but don't swallow everything that comes out of Redmond" philosophy later, and the reasons for it. Most of those reasons come from having gotten burned by the poison-pill effect of adopting Microsoft's technologies. While I use Windows, and quite like it (Windows 7 is great), I abhor almost all the additional layers and components that they have put on top. I abhor them, because Microsoft has made me suffer like no other company has ever made me suffer. Bugs in Windows components have caused me more pain than anything else in my programming career. This pain is deserving of comment, and I will expand on it later.

4. Delphi Components. Components, and their designtime and runtime elements are the best part of Delphi. Imitated, or reimplemented rather, in C#, and the .Net Framework, and copied poorly again in the "Java Beans" model, they are missing key elements of what makes them great in Delphi. If you have never tried Delphi, you have never experienced the amazing capabilities of the component model. There is nothign to equal them. Not coincidentally, there is nothing out there to equal the delphi component ecosystem that exists in the wild. Sadly, the commercial field of component vendors is much thinned as of late, but the remaining companies selling commercial delphi components sell great stuff. The delphi Open Source Component ecosystem is thriving. I will write about that separately as well.

5. Delphi programmer community. My fellow delphi developers. You guys rock.

6. The Object Pascal language, a thing of beauty. More or less. I'll write about the beauty, and the warts, in another place.

7. The VCL framework. The most awesome framework ever written for windows, although a little long in the teeth, still quite respectable. The "Properties and Events" elements of the VCL framework merit special mention, and I will cover them later.

8. The IDE. The Rad Studio XE IDE is the richest IDE I have ever used. Not just a text editor, it contains "Together" based refactoring and diagramming, audits and metrics (for Boring Manager Rob's benefit, as well as Code Monkey's benefit). Recently, the IDE added the F6 key "IDE Insight" which is my favorite IDE feature ever.

9. Direct Windows API access, painlessly. Thanks to Delphi's native integration with Windows, and the giant Windows unit, almost every core API of windows is already available to me. For anything really advanced, or out-of-the-core-kernel/user dlls, the JEDI API project provides wrappers for almost everything under the sun.

10. Small is beautiful. Delphi creates (for the year 2011) pretty small output, when you want it. If you go back to Delphi 7, you can get insanely small executables. This is really handy in lots of places, and not just for virus writers.

And that, my friends, is why Delphi is the best thing out there.


  1. it's seems very nice but can you talk about c++ builder?, i consider that is the brother of delphi.

  2. I will consider writing up about C++Builder. I have a long standing love/hate relationship with the C/C++ family. There are things I love, and things I hate. In facebook terms, "It's complicated". I love the precompiler, except when I hate it. I love the C++ language except when I hate it. Is anybody else out there as ambivalent as I am? I pretty much loved writing pure C code in the pre-C++ days, and the joy is gone, ever since C++ came in and took over.

    Some day, if C++Builder supports C++2011 standards, I might actually enjoy using C++.


  3. The thing about C/C++... it just doesn't feel right to put all your code in { comments } ;)

  4. For Windows development nothing comes even close to Delphi. I'm pretty sure that many people think that Visual Studio is the only IDE for Win.