Delphi XE5 Thoughts: Contemplative

Just got my hands on Delphi XE5.  I know that, although the crew at Embarcadero probably broke out the wine and cheese to celebrate the release of their first Android-capable IDE and Compiler, and certainly what they’ve accomplished is a feat no other company, with the exception of Unity3D, has accomplished; I can’t help but imagine that there are some engineers and testers over there that are not feeling too happy right now.

Delphi, if it works, will end up in a market position to offer customers the only true business-app-friendly development experience that can be deployed to IOS/Android/OSX/Windows with a single codebase powering everything down to the GUI.  Unity3D has accomplished this, but is geared almost entirely to game developers and is very lacking in GUI features.

I, however, can’t help but imagine that the guys over at Embarcadero know that they just shoved another unready piece of junk out the door, and although, on the outside, they appear to be celebrating, they know, that deep down inside, if they don’t make real change, their customers, company, and jobs will be no more.  But Delphi has been on the verge of extinction since Anders Hejlsberg was poached from Borland and joined Microsoft around 15-years ago.  Staring down extinction is nothing new to them, right?

XE5 was released less than 6 months after XE4, the IOS version.   It makes me recall certain episodes of Hell’s Kitchen, where Gordon Ramsey goes into a shitty restaurant, orders up some steak and potatoes. The server surprises him and comes out of the kitchen 25 seconds later with steak and potatoes and he’s like, “does it always come out this fast?”  Ramsey obviously knows that somethings up, and the food he’s about to eat is likely covered in hairs and mold and the kitchen he’s yet to inspect is a total mess full of incompetent workers.  Sure enough, Mr. Ramsey finds that his steak had been sitting on a greasy grill, precooked, 2 hours earlier, and the high-school kid running the kitchen just stuffed it in the microwave for 25 seconds before handing it to him.

I’m not saying that Embarcadero is full of incompetent people.   They’re blazing new trails with Delphi XE5 and Mobile, certainly.

But I’ve been pressured plenty of times in my career, by marketing departments and executives,  to release software that isn’t ready.  Every time it happened, I went home that night and lost plenty of sleep over the decisions of that shiney-toothed asshole in the marketing department who decided it would be better to release a turd and piss off customers than to release something stable and good a bit later than anticipated.

Clearly, XE5 is not ready for release.  When I attempt to build and run a very simple application consisting of just a couple of controls on a form, there’s only about a 75% chance it will compile, a 50% chance that the app will start, and a 25% chance the app will connect to the Debugger.  The compiler randomly tells me that files are not found, even when they exist (someone probably forgot to set a result in a function somewhere or forgot to initialize a variable).  When runninng apps, the apps I build often begin to load, but my phone screen just turns blank until I restart it again.  When debugging, the debugger seems to hang the gdbserver in the phone after just a few runs.  When this happpens, it fails to connect until I reboot my phone.  If anyone knows how I can kill the gdbserver process on my phone, please let me know, I’m sick of rebooting my phone.

I’m still just getting started with proving it out, so maybe I’ll get used to its quirks and find workarounds to live by, but it all feels sketchy.  I would, honestly, lose sleep if I published an app as simple as a “hello world” application with this thing, and I will have only Embarcadero to blame for my customers’ poor experiences with my app and myself for choosing such a tool.  My hands will be tied and I’ll be forced to tell my customers that I can do nothing for them but wait for a Delphi patch (which I’m sure will cost me $700 in the form of Delphi XE6)… or get my hands dirty doing Embarcadero’s job for them, hunting bugs in firemonkey.

Despite being native, performance is pretty poor.    Load times are long, and screen updates are sluggish.

Regression testing is going to be a nightmare thanks to the change to ZERO-BASED-strings across the board and automatic reference counting, which are biting me really hard right now.   You now have TWO (or maybe three) completely different compilers that treat your code completely differently.  The compiler for Windows has not been updated, and lacks many language features of the new compiler, however, the new compiler drops support for MANY things and drastically changes the behavior of many aspects of your code that have remained stable for 20 years.

Up until XE4, one of Delphi’s big claims to fame was backwards compatibility, but now, they’ve seemed to replace that idea with a new mantra: “complete, utter, regression test failure”.   There’s basically a 0% chance that you’ll be able to take any class or piece of code, however mundane and simple, and port it to IOS/Android and be able to trust that it works.   The compilers for Windows vs. IOS/Android are SO different, that it is almost like a different language.

If you have any code that relies on destructor code to execute immediately upon calling “Free()” you’ll find it very broken.  To combat this problem, I’ve had to separate out much of the code that would normally be placed in the destructor, into a separate function which I explicitly call.  I call it “Detach()”, which has the sole purpose of isolating the object for garbage collection.  They could maybe at least help us out at at LEAST call BeforeDestruction() on Free() or something, but instead, Free() does literally nothing and your objects are not freed until their reference counts hit zero.  So if you use Monitors, observers, or any kinds of Parent-Child relationships in your classes, you’ll have to change the way you do things.   They added a new [weak] attribute (completely unrecognized by Code Insight) to help out with those things, but I’ll have to learn to trust it, and I’m having some serious trust issues right now with Delphi.

If you have any code that manipulates strings as 1-based arrays, you’ll find it broken.

If you make calls to functions such as pos() to search for substrings in strings, or copy() to return substrings from a string, you’ll find it broken.

If you make any reference to ansistring, utf8string, and many other string types, you’ll find them unsupported (which is funny because it wasn’t long ago that they were ADDED to the  language).  Luckily, I’ve been able to (mostly) replace ansistring with an operator overloaded record.  Comment and maybe I’ll share my ios.stringx.ansi.pas unit with you.

I’m dealing with these problems by writing a small app that runs regression tests in a way similar to how unit tests are run.  I’ve only just got started and I currently have over 400 test routines just for strings.

I feel kinda like I’m in prison on a chain gang and it’s “make work time”,  a term used in hard-labor prisons when they’d have the inmates do something pointless, like dig a big ditch, only to have them pointlessly fill it up again.  The idea being to make them work even though there was no work to be done.  With Delphi XE5… yeah… I feel like it’s “Make work time” for sure.  They could have put better systems in place to smooth the transitions from 1 to 0-based strings and could have a better system for dealing with reference counting than the ARC directives they provided.   The work I’m doing right now, dealing with 7.5 million lines of code that all needs to be regression tested, seems really pointless.

So yeah… uh… XE5, unless you stick strictly to your windows target (which uses the same-old same-old compiler that’s stuck in the dark ages and riddled with increasing internal errors), you’ll find that XE5 busts the hell out of your code and gives you no easy way to port your code forward other than to test the hell out of everything and carefully review every line of code…

…and that’s what I’m doing.  I’m sitting on 7.5 million lines of Delphi code.  I’m possibly the most loyal of the hardcore Delphi developers out there.  Despite my frequent two-timing with C# and Unity3D, Delphi is still a tool that I use every day.  But XE5… wow… I don’t know if I can trust you, XE5.

 

One Reply to “Delphi XE5 Thoughts: Contemplative”

  1. No I did not discuss it with reesllers, but I sent a mail to Embarcadero when they added the offer for the 2010 barely over a month after my purchase. No replies as of now.And no, I won’t cheat by joining the project again pro-forma. There is nothing I could contribute at the moment.

  2. Comment from AdamABC: XE5 really does sound like a nightmare. I was considering making the upgrade for the cross-platform functionality, but it seems like it might be more hassle than it’s worth. Even so, I have to wonder if the conveniences would outweigh the heartaches in the long term. Thoughts?

Leave a Reply to Mario Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.