Saturday, 18 April 2009

Generics in Delphi 2009

I've now had Delphi 2009 installed on my machine for about a month, and have been refactoring some code to take full advantage of Generics and Anonymous methods. I really like generics, but am beginning to feel really uncomfortable with the Delphi implementation. It just doesn't feel 100% stable. I get the occasionaly internal error, which then dumps you somewhere at the very beginning or very end of a file, with no indication about what you have done wrong. Try adding the overload keyword to a method in a generic class, without actually overloading the method for example. Code completion is a bit of a mess, sometimes working, and sometimes not. I won't even mention the TDictionary class, which is practically useless, as it is riddled with bugs. Well perhaps not riddled, but there are a few, making it unusable. Try using the enumertors for example.

Why release it when it clearly needed a little more work? When is it going to be fixed?

6 comments:

Anonymous said...

It's funny that in 2009 some people are still using Delphi. "A program is a Form.. lol" I hoped it was over at the loom of the new millennium. Get on, "Delphi Users", you've still a way to go to become software engineers.

Richard K said...

You are not the first to mention that there are issues with the D2009 generic implementation. I also really like them and I am using them but I am getting a bit nervous...

I would like Nick Hodges to respond to this issue. Are there QC issues for these TDictionary problems? And when are we going to get an updaet that fixes them. Don't tell us we have to wait until D2010. Please, no, no, no..

Richard

Richard K said...

The other issues with TDictionary that I am referring to are in the comments of this article http://beensoft.blogspot.com/2008/09/simple-generic-dictionary-tdictionary.html

Richard

Mason Wheeler said...

Yep yep. Generics in Delphi are badly broken at the moment. It looks like Update 3 will fix the issues, which is due out RSN as soon as CodeGear fixes some "non-technical issues" that are holding up the release.

Anonymous said...

Started using them, but then stopped adding any new one when one of our packages started not *linking* anymore.

Compiler crashes are bad enough, but at least you can figure out the compiler didn't like something in your unit. When the linking fails, you're left high and dry, especially when everything that is in the package compiles and links "fine" in other binaries... you wonder "fine for how long?"

Anonymous said...

This is the primary reason preventing me from stepping up to D2009.

I have been spoilt rotten by Generics in C#, esp. Dictionary, and I really, really wanted that in native Delphi.

But if it's not reliable yet, (and Unicode isn't a must-have issue for me yet), I guess I'll stay with D2007 for now.