Free Yourself

[Estimated Reading Time: 4 minutes] Barry Kelly recently posted an example of “smart” pointers (specifically the auto-pointer variant of a smart pointer) using generics in Delphi 2009.  It was an interesting use of generics but the end result was something that has – in part at least – been possible for some time in Delphi even without generics – reliable cleanup of objects. This was something that a colleague of mine, Geza Sabo, pointed out, based on some code I’d previously shared with him to robustly manage the hourglass cursor in a GUI application.

This Weeks Poll

[Estimated Reading Time: < 1 minutes] I’ve worked with a number of version/source control solutions over the years, and looked at or even evaluated  even more.  None has really been perfect, and very few even come close, each with their own strengths and weaknesses. But what do you use with Delphi? Recognising that people perhaps use one system at home and another in their “day job” (or even on different projects within the same organization), you can choose up to three responses for this poll.

Delphi 2009 – StringPerformance Redux

[Estimated Reading Time: 3 minutes] It looks like I may have jumped the gun with my conclusions from the previous exercise to benchmark string performance in Delphi 2009.  Following a useful exchange in the comments with Kryvich I corrected a small discrepancy in the tests and made some changes to the performance testing subsystem within the SmokeTest framework.  I then re-ran my string performance benchmarks with some significant – and more encouraging – differences in the results.

Delphi 2009 – CompilerVersion

[Estimated Reading Time: < 1 minutes] Just a short post this one. Somebody else may already have mentioned this, but I only just figured it out for myself – the CompilerVersion for the Delphi 2009 compiler is not what you might expect (and is not what the documentation says it is!). Both CompilerVersion and RTLVersion have the value 20 in Delphi 2009. In Delphi 2007 these were 18.5 and 18.0 respectively.  Confusingly the documentation is correct for RTLVersion but incorrectly gives 18.0 as the value for CompilerVersion. Is anyone else wondering what happened to 19? Did Delphi 2008 happen after all and I just missed it?

Delphi 2009 – A Heads-Up for Low-Level Coders

[Estimated Reading Time: 8 minutes] Prompted by a conversation with some colleagues where-in we collectively speculated about the implementation details of a generic class and what impact – if any – this might have on performance vs a “traditional” polymorphic equivalent, I threw together a quick performance test case in my Smoketest framework, and as a result discovered a couple of significant changes in Delphi 2009 that created some unexpected problems.

Patching A Class VMT

[Estimated Reading Time: 6 minutes] Caution: The contents of this post may cause dizziness or nausea.  Take only as prescribed and if symptoms persist seek professional advice. Recently I found myself needing to do something I had never done before – create an instance of an arbitrary class derived from some base class and destroy it, and do so without invoking any constructor or destructor code that the derived class(es) may have introduced. This is the difficult bit. Impossible?  Don’t be silly, this is Delphi we’re talking about….

Another Week, (Yet) Another Poll

[Estimated Reading Time: < 1 minutes] Last weeks poll was interesting – I was surprised to see such a high proportion of those polled indicating that they don’t do unit testing – slightly more than 50% in fact.  It wasn’t a huge sample size, but even so it surprised me. So that got me thinking about the use to which visitors to my blog are actually putting Delphi – unit testing isn’t relevant to everyone of course – and so I thought it might be useful to ask that question this week. This is another multi-response poll.  You may choose all the answers that apply to you.

Making A Splash

[Estimated Reading Time: 5 minutes] OK, so who hasn’t done this a million times – adding a splash screen to a Delphi application.  I’ve seen any number of “easy” ways to do this but during a session at Tech Ed ’08 this week I saw the latest in splash screen technology from Microsoft:  A SplashScreen API and build action supported by WPF 3.5 and VS 2008. I immediately thought of my Application psuedo-class and object in Deltics.Forms.