Anonymous methods and Generics in Delphi 2009

I was just reading through some of the comments on Anders’  blog in response to his post on positive feedback on Delphi 2009, and I came across this comment:

…Honestly Nick, I think in the day to day win32 programming world, I can’t think of any reasons for using anonymous methods or generics. …

It’s hard to understand the power of anonymous methods if you haven’t used them for a bit and truly see the beauty of them and how they can make your apps so much more flexible and easier to write and maintain. But Generics? You find no use for generics? That’s unreal.  Again, I think a lot of this is coming from the drag-n-drop culture and not truly using object orientated programming (I don’t mean that as an insult to anyone, let alone the person that posted that comment)

In all honesty, I think with all the new features Delphi 2009 has in comparison to 2007, it is well worth it.

8 thoughts on “Anonymous methods and Generics in Delphi 2009

  1. Jim McKeeth

    I agree: Unicode, Anonymous methods and Generics are huge improvements for Delphi 2009. Anonymous methods may be of less obvious use then the other two, but if you have ever tried to do the kind of coding that would benefit from them, then I am sure you are incredibly excited to have these features. I’ve been waiting for all 3 for a while now. The only other thing I have really thought Delphi was lacking was Win64 support, which is coming out with Commodore (next version of Delphi – in a year to year and a half).

  2. Hadi Hariri


    Unicode? What’s that?

    Oh wait. Isn’t it that feature that people were bitching and moaning about day in, day out, complaining constantly how Delphi should support it? How they didn’t want to have to resort to 3rd parties to support it…

  3. Sergey Antonov

    Implementation Generics (in the form CLR .NET 2.0 )in native Delphi is a very bad decision. Here is some reason:

    1. In native Delphi there is no necessity to using constraints. Using invalid operations on typed parameters can be revealed at compile time by compiler,
    even operators contstrains proposed by Craig Stunz.
    Why to force programmer do the work that in any case would be done by compiler later?

    2. Restriction on using operators(inlined) on native Delphi generics is very big hole. Very big performance penalty. And it enforces some limits on generics applying for fast and robust native Delphi application.
    And tricks such generating generics class operation wrapper at run time(e.g. IComparer<T>) by RTTI index is not very good as it may comes into view at the first time.
    a. Indirect call via VMT with performance penalty is not the only one problem.
    b. It is a very restricted operation. No way to compare types T and U. Only T and T.
    Why not to Look for operator methods in RTTI of type with combination of paramater T and U?
    3. No mixin.
    Restriction of type parameters to be a parent of parametrized class. All offsets to fields can be infered at compile time.Why to restrict this?

    I am almost sure that the problem is the caution to "All world wrapper" .NET.

    So the only way i see to rescue the Delphi is to freeze generics use in currrent state. And look at C++ templates as powerful substitution.
    And if it would be done with ability to write managed and unmanaged code together- Delphi become the real Shark.

  4. Brett Graffin

    I have posted a lot of the complaining on some of the other blogs. A lot of the people who have responded back are not listening to the people who are complaining. and there are people who are complaining. We understand that you need or want Unicode. We understand that you think Generics and Anonymous methods are something useful. You are sold, we are happy for you. It’s your turn to get in a release what you wanted. If you remove those 3 things, there is not that much more that is useful enough to warrant purchasing this update. The "complainers" don’t use or want those 3 features. We don’t care about them. We’re making a statement that were not going to update. I guess that is our loss. We look at this release as a jump over release, like Delphi 4, Delphi 8, and should have been Delphi 2005 as well. We will see you guys when 2010 comes out, or maybe not.

  5. Andreas Hausladen

    What do these numbers have in common and what do they have to do with Delphi?
    (1), 2, 3, 5, 7, 11, [13]

  6. Jolyon Smith

    @ Andreas – lol

    I never thought beyond the rough "even = bad, odd = good" rule before (the Anti-"Star Trek" Pattern of Delphi releases). The general case would now appear to be "prime = good". Roll on Commodore!


    Having said that, Delphi 2009 is so far proving to be a worthwhile release.

    Whilst generics are severely limited in usefuleness and anonymous methods an abomination – or at least likely to result in abhorrant code – (imho, ymmv), Unicode is in itself "a good thing", although the draconian implementation approach might be cause for concern, and the overall improvement in IDE responsiveness is definitely a good thing.

    Other changes in the IDE are not so welcome – the Project Options dialog is now an absolute mess.

    VCL changes are not very well thought through – I’m getting REALLY fed up of properties in the Object Inspector obstinately refusing to change, only to discover that they are only supported on Vista. Surely there was a better way to handle some of these at least?

    The ribbon control is a sad disappointment. It simply is not release quality – buggy as heck and with diabolical performance.

    It is quite interesting though that despite these problems I never-the-less find myself favourably dispositioned toward Delphi 2009.

    Go figure.

  7. Thomas Mueller

    I would have preferred to get generics and anonymous methods without being forced to Unicode. I don’t need Unicode and it breaks most of my company’s programs, so I will be stuck with either fixing all the Unicode issues (which would be a good thing if it didn’t take lots of time) or staying with Delphi 2007. Since I don’t have time, Delphi 2009 – got it with SA – will sit on the shelf for quite a while, which is a real shame.

  8. JB

    I suppose ignorance is bliss, I will keep watching the passing scene until there is something that I know I need.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s