Home > Delphi > Welcome Back Delphi

Welcome Back Delphi

Several years ago I said goodbye to the programming language in which I took my first stumbeling steps as a coder. I had moved on and there were no reasons to believe I’d ever go back. I was wrong. A reason emerged and Delphi 2009 now has a place, both in my computer – and in my heart.

Delphi 2009 comes with a great IDE

A sort of homecoming

Firing up the new IDE from CodeGear with Delphi for Win32 felt a lot like coming home. The outstanding graphical editor was there as was the lightning fast compiler. Visual Studio is great in many ways but it can’t compete with CodeGear’s RAD Studio when it comes to speed and rapid application development.

Not only that, the language (Object Pascal) has finally woken from its stagnated state and is getting increasingly modern. It now implements, for instance, closures (anonymous methods) which is quite rare for a non garbage collected language.

type
  TClosureProc = reference to procedure(AMsg: string);

function CreatePrefixedWriter(APrefix: string): TClosureProc;
begin
  Result := procedure(AMsg: string)
  begin
    WriteLn(APrefix + AMsg);
  end;
end;

var
  Log: TClosureProc;

begin
  Log := CreatePrefixedWriter('Closure Test: ');
  Log('Write this');
  Log('And this');
end.

The above program should produce the following output.

Closure Test: Write this
Closure Test: And this

I gotta wear shades

I am not the only one being thrilled with the rebirth of Delphi. A look at the TIOBE Programming Community Index for February shows that Delphi is the 9th most popular programming language, with a steady increase. That is a lot better than the 15th position a year and a half ago. At that time Delphi felt like a marginalized language with little promises for the future; Now it feels alive and vibrant.

Since the magic is back, I think I’ll stick around for a while.

Cheers

  1. February 10th, 2009 at 20:30 | #1

    Oy!

    Perhaps not everyone is aware that Delphi is still being used in several areas but that doesn’t mean it’s back :). Delphi will never be back with Embarcadero. It’s nice though to see that Delphi is still alive somehow but what Delphi lacks is the platform independency which is really important nowadays. When I have to decide what language or technology I have to use this independency really matters. Why do I want to stick myself to an operating system in the first place? Even if I’d just plan to use a specific operating system at first I still want the opportunity to change later.

    I myself used Delphi from version 2 to 4 (including) and I really loved it because I could create things in a really short time. Rapid application development was reality with Delphi but just for the Windows operating system. Later on they showed up with Kylix which is still the biggest crap they’ve ever released.

    Now your blog caught my eyes and I thought “yessir!” and hoped they’d release something more open. More open to a standard which exists but no, they are still doing their own things. Let’s see Ada e.g… They established a standard and if you have a standard compliant Ada compiler you can be sure to compile your code that was valid even >10 years ago so what does Embarcadero offer? Their own.

    Sometimes I think about doing some objective pascal but then I think “na! not worth the time” and I’m always right and do you know why? Because I simply don’t need it and I simply can’t have it. Everyone agrees that freepascal e.g. is sane but how useful is freepascal to me? The success of a language is not always made just because of the language itself. I need interfaces to all kinds of libraries, database systems etc…I know that there are several bindings but they are in contrast not sane. And yes, I’m talking about freepascal because they at least try to establish something but they aren’t following the strict standard. There is also the gnu pascal project and they seem to follow certain standards which is really nice but they have the same problem as freepascal. Even worse…for gnu pascal there almost no bindings to anything. Yes, it’s quite easy to build them yourself but it’s also a matter of time and time means money.

    Well, I think I’m probably just wrong but that’s my feeling about this topic.

    Kind regards,
    Andreas.

    • February 11th, 2009 at 07:51 | #2

      Thank you for sharing your thoughts Andreas. I’m a right tool for the right job kind of guy. If I need platform independence I’d go for a virtual machine based architecture, but if I want to build an application targeted for the Win32 platform I would look for a better fit. That’s where I think Delphi still has a role to play.

      I have no opinion of Embarcadero. As long as Delphi goes on evolving I’m happy.

    • February 11th, 2009 at 07:52 | #3

      And yes, Kylix was a big disaster.

  2. February 10th, 2009 at 20:58 | #4

    Andreas: They’re currently working on new compiler technology that will make cross-platform compilation very simple. I agree it’s taking way too long, but by all indications they’re back on track with Embarcadero.

    Borland ran Delphi into the ground. It’ll take a little bit of time to get back on their feet, but they’re definitely moving in the right direction and soon they’ll be back on top.

  3. February 10th, 2009 at 21:07 | #5

    heh, let’s hope they are not “Getting back on track tomorrow” but getting back on track yesterday :).

  4. Volomike
    February 10th, 2009 at 21:48 | #6

    Yeah, but you’re screwed when you get your begin/end stuff out of alignment. It’s kind of hard to figure out which end goes to which piece of code. And it’s even more difficult when an if/then statement is one of those two-liner deals where the end is implied.

    And if I mail my PHP or C/C++ code to someone, and the email changes the line wraps, the code usually runs. But not so Delphi.

    That’s one of the main reasons why I don’t do Delphi.

    It also suffers from custom control upgrade issues that VB suffers with.

    Soooo glad I’m on PHP and purely doing web development on Linux.

    • kwanbis
      February 11th, 2009 at 01:18 | #7

      Where did you get that from? Where the Begin/End are placed have no importance, if you have them correctly separated by ;

    • February 11th, 2009 at 08:02 | #8

      I’m afraid you’ve been misled on this one. Delphi (Object Pascal) is mailable, with or without line breaks, trust me. And begin/end is equally easy, or difficult depending on how you look upon it, to get out of sync as brackets.

      With that said: I love working in PHP too. It’s my favorite web development environment next to Ruby on Rails.

  5. Stelios
    February 10th, 2009 at 23:36 | #9

    See Delphi was a copy of Visual Basic, a RAD tool, only done right. The VLC library was trully an amazing piece of work. Object oriented, very nicely wrapped around all parts of Win32 and extremely fast! The assembler code emitted by the compiler was just phenomenal.

    At the time you could use MFC with C++ to build a non-hackish (I mean proper) Windows based application. It was patchy and stiff. Even Microsoft did not trust MFC for their applications!

    From what I remember Delphi would trivially cooperate with assembly, C and COM libraries. So the interoperability argument doesn’t sound right. I believe that at some point it went all the way to .Net (not tried that).

    It died because of Java which took a heck of a lot of ideas from Delphi (the whole thing of a proper library with template-ish data structures, including the actually worse in my opinion Swing thing) and added for the first time no-hassle cross platform code.

    I still think cross-platform C is just a sick joke and .Net is digging its own traps by ignoring the stuff across its platform. I would say by seeing C# 4.0 it seems to me more of an academic project or a designerly experiment.

    The reason I wouldn’t go back there is the strong typeness of Pascal. Oh man what a paranoid type checking extravaganza that was. The world of applications is getting dynamic and I don’t see how that would fit with the language. It’s like putting a Ferrari engine on a beatle car.

    • February 11th, 2009 at 08:09 | #10

      Totally agree, except that I still enjoy the fail fast property that comes with strongly typed languages and a fast compiler. But that’s the only thing I miss when working with dynamic languages like Ruby and JavaScript.

  6. February 11th, 2009 at 00:29 | #11

    I was a huge fan of Delphi from versions 3 to 6 back in the days. I wrote a few noteworthy systems using Delphi. And a bugfix (or two) of mine even made it into the VCL.

    But as a contractor/consultant, some of the worst code I’ve run into has been written in Delphi. Something about having a low barrier of entry, like Visual Basic, attracts many untrained (hobby) developers. One of the ugly side effects of RAD. In any case, the older I get, I find that my brain (and carpals) seems to reject verbose languages like Pascal.

    Though to be fair, I’ve grown to equally despise Java for both similar and different reasons. C# is still my daily-use, workhorse language. Albeit, I’ve been slowly gravitating towards terse, dynamic languages as preferred. Any chance I can use IronPython or IronRuby, instead of C#, I take it. Less typing, faster dev time, easier to manage dependencies, more flexible and adaptable…

    • February 11th, 2009 at 08:15 | #12

      Yes, a low barrier has its pros and cons. What I always appreciated with Delphi is the fact that it has both a low entry cost and a high potential. There was nothing you could do in say C++ that couldn’t be done in Delphi, often with less effort.

    • John
      February 11th, 2009 at 13:22 | #13

      Any developper that equates less typing to faster dev times is a liability in my book, as they’re typically one-step shy of using single-character identifiers (or considering everything is either a hammer or a nail, which is just as bad), even though they often don’t realize it themselves.

      • February 14th, 2009 at 06:38 | #14

        I was referring to the verboseness of the language, not personal coding style, or object/variable names. There is no need for a language to be overly verbose. Language warts are usually constructs used by lazy compiler writers.

        Mainly I was pointing out how my preference has evolved away from strongly-typed, static compiled languages and towards dynamic, interpreted ones.

  7. Samuel Herzog
    February 11th, 2009 at 05:36 | #15

    Welcome back!

    Delphi, my daliy-use IDE since 1996.

    Reasons:
    – Good IDE.
    – very fast compiler.
    – fast Applications.
    – thousands of components.
    – easy to deploy the Applications.
    – Applications run also on Linux. (WINE)

    What should be improved.
    – smarter way to pass a project from one person to another.
    – remove #J and .NET stuff from the IDE.

    • February 11th, 2009 at 08:21 | #16

      Thank you Samuel. For me, the most important improvement should be to fix the awful help system. Highlighting a word and pressing F1 usually doesn’t get me the information I seek anymore.

  8. Bruce McGee
    February 11th, 2009 at 11:06 | #17

    Delphi stumbled a little, but it didn’t really go away.

    Welcome back all the same. 🙂

  9. bulloni
    February 12th, 2009 at 17:45 | #18

    Delphi is ok. But I’m running out of business cases for it. Most of my work is web or embedded (ARM) nowadays…

  10. Robert Höglund
    February 13th, 2009 at 08:37 | #19

    Oh Delphi! Once we had a love affair you and I. I remember the days when I took my first baby steps as a programmer and you were there to hold my hand. Such applications we made you and I. Then I started cheating on you, moving on to newer and shinier things. Little did I know that you would come back to my life, with a vengeance. In my present job you were hiding, in the disguise of badly written Delphi 5 application. Once again we began to speak to alas, the spark was gone, lost forever in the midst of programming languages that actually care about my feelings.

    I liked Delphi back in the days but I don’t think I ever will go back. Just having to declare all variables at the beginning of a method makes me want to smash my head in the wall.

    • Hans-Eric Grönlund
      February 13th, 2009 at 10:29 | #20

      That story sounds like something I could have written 🙂 Nontheless I’m back using it, and I actually enjoy it.

      I don’t have a problem declaring the variables at the top. What I do have problems with is the lack of garbage collection. It turns out I’ve gotten so used to it that working without one is now somewhat painful.

    • ron
      March 5th, 2009 at 09:07 | #21

      You could use Castalia for inline variable declaration. They’ve been improving the IDE pretty well though, so perhaps this nice feature will be in a future versions:

      http://www.twodesk.com/castalia/inline_variable_declarati.html

  11. Ebrahim
    February 14th, 2009 at 16:51 | #22

    When I read title of your post, I wished you’ll be talking about Lazarus.

  12. Troodon
    February 19th, 2009 at 06:48 | #23

    I too love Delphi but let me see if I get this right — to you, Delphi has made a come back because:

    1. Great IDE (I thought it was also great before D2009).
    2. Fast compiler (see the above).
    3. Anonymous methods. Now, is there a reason why one couldn’t develop fantastic applications in Delphi without using anonymous methods?

    • Hans-Eric Grönlund
      February 19th, 2009 at 07:43 | #24

      Good question! But you’re slightly off when it comes to the reasons you listed.

      My point is that it feels like Delphi has finally turned a decline in both quality and interest with the 2009 version.
      Of course one can develop fantastic applications without anonymous methods, that can be done in any language, but the thing is, adding these features send the signal that Delphi is a live and evolving language. And, for a language that supports the functional paradigm (along with the object orientation) closures is a natural and useful construction.

  13. Troodon
    February 19th, 2009 at 06:53 | #25

    Having to declare the variables is actually a good thing, IMHO. The alternative would be to risk finding oneself imerged into a “white noise” kind of code after a while, Perl-ish style. And yes, the Help system is horrible; I miss the Delphi 6 Help system.

    • Hans-Eric Grönlund
      February 19th, 2009 at 10:01 | #26

      There’s always pros and cons with everything. I can’t decide which way of declaring variables (at the top, in the body, or not at all) is better. It depends. And I embrace them all.

      I agree with you on the help system, but that, on the other hand, is the only thing I miss from the Delphi 6 IDE.

  14. Troodon
    February 19th, 2009 at 07:02 | #27

    If we skip the scripting languages in the “TIOBE Programming Community Index” and we confound C, C++, and C# then Delphi is in position four. And I bet most VBasic programmers chose that language because it’s all they know, rather than because they think it’s better than Delphi.

  15. JimE
    March 5th, 2009 at 02:47 | #28

    I just don’t get it. What’s wrong with doing it this way???!

    procedure Log(AMsg: string):
    begin
    WriteLn(‘Closure Test: ‘,AMsg);
    end;

    begin
    Log(‘Write this’);
    Log(‘And this’);
    end.
    The above program should produce the following output.

    Closure Test: Write this
    Closure Test: And this

    • Hans-Eric Grönlund
      March 5th, 2009 at 07:59 | #29

      Good question!

      In your example the prefix is hard coded in the log function. If you’d like another log function with a different prefix you’d have to create another function. Additionally, the code that utilizes your log interface is bound to that particular log function.
      In my example I can easily create a different (prefixed) log function dynamically and have the utilizing code invoke it without change.
      Of course the same effect can be achieved with a nice object oriented approach, (or even with your approach and a global prefix variable) but the purpose of this post was not to show how to create a prefixed log function…

  16. Stephane Wierzbicki
    March 5th, 2009 at 20:45 | #30

    I’m using Delphi for almost 9 years !
    Nothing is impossible with this great tool.
    The new RAD Studio edition is really really a good product. I really hope that Embarcadero will lead Delphi back to it’s glory road.

  17. March 5th, 2009 at 21:18 | #31

    Me too! I really hope Embarcadero succeeds. They’re definitely on the right track with the 2009 version.

  18. February 11th, 2010 at 05:51 | #32

    Delphi is still used .

    I use Delphi 7

  19. G S
    June 29th, 2010 at 04:55 | #33

    Delphi 2010 is EVEN BETTER than Delphi 2009. I am loving it (other than help, but it is getting better).

  20. Luis Calderon
    July 11th, 2010 at 08:11 | #34

    I’ve used Visual Studio, Netbeans, QT and other enviroments and I can tell you that to this day, Delphi is still the best for RAD tool out there. Period!

  21. Omair Iqbal
    July 28th, 2010 at 12:50 | #35

    i agree with G.S Delphi 2010 is JUST AMAZING i was expected it to be better than 2009 but when i played aroung with the ide for a while i was amazed by how much they have improved their RAD in terms of quality and speed

  1. February 12th, 2009 at 02:01 | #1
  2. March 5th, 2009 at 19:16 | #2
  3. June 3rd, 2009 at 20:25 | #3