Sunday, October 30, 2016

Delphi 10.1 - an unbiased review

If you are a developer, you may get ads targeting you and recommend to use Delphi or C++ Builder. It happens that if you install C++ Builder (named "Starter Edition") you may not install Delphi Starter or vice-versa.

As my interactions with Delphi, I was liking Pascal language which I've learned in highschool and I kind of like it today. I also used many free editions of Delphi (initially it was packed with Chip Magazine) like Delphi 6 PE (Personal Edition), Delphi Turbo (a slim down version of Delphi 2006). I had also been using a Delphi 2009 and XE3 (licensed for my previous company).

In short, I could say that I could notice a bleak quality around 2009 toolset, and I've been told that Delphi 2006 was similar, but I didn't notice it. XE3 left me a bit disappointing note also, being overly priced and so on.

Let's go back to review. First of all, let's talk performance of the compiler and the generated code. Frankly, it is "good enough" but expect it on the level of .Net (or a GCC -O1 level), and not around Java (which tends to be on level of GCC's second level of optimizations). I am not sure if I break licenses (as many things are concerned), but in general I found the code would be a bit slower in math related code. Even the compiler is generating not that good code, honestly is not that bad, it is though very quick. In fact, is is that quick, that I was kind of really surprised. Of course, I have an SSD, and so on, but really, I cannot notice the build times. (Maybe for the size of project).

What I could also notice, is that, applications do use very little memory, starting with Delphi itself (which is written in a mix of Delphi and C++ languages). Delphi uses at startup for a 'hello world' like desktop application 100 MB! 100! Comparing it with Lazarus, which use a bit less, as is a less featured, it uses in fact 42 MB. Maybe these numbers do not mean much for you, but maybe we should have the VS IDE. Visual Studio uses on my machine 150 MB. The bigger is the project, the memories also grow. I am not here to say that you should evaluate a tool for memory use, but it looks that the toolset got a lot of love lately.

I didn't notice bugs at least based on my limited usage. I notice though some fewer features that I got used with Java IDEs or Visual Studio, but it felt snappy and cool. Especially in refactors area, there are no refactors in the Starter Edition (or if they are, I did not find them). Lazarus has them!

Is it Delphi a good tool? Definitely! Would I recommend to someone? Yes, especially if you have some companies that cannot afford to install runtimes on customer machine, don't want a buggy IDE (I am thinking here about Lazarus, even though also Lazarus did improve there), and you want to get some commercial components and make quick an application.

Would I use it? Definitely not. I will write here all my noticed gripes, but many of them are related with my experience, so don't take them as a Delphi hating person:
- memory management is a lost cause in my view in Delphi: it is overly-verbose (only the phone applications have reference counting).
- there is no sane way to do something like Linq. For me Ruby looks to me very equivalent to Delphi (or Visual Basic), but the things split when lambda expresisons are used. I would love to write something like: lines := FileExtensions.ToLines("input.txt").Where(line=>length(line)>0).ToList();
- there is Lazarus. Even I personally don't think that Lazarus is a clear replacement for Delphi, it is a damn good tool using a very similar language. Excluding you are locked in with a vendor component which you cannot find a replacement to it, and it cannot be recompiled for Lazarus, I see very few reasons why not to report bugs to Lazarus and not to pay.
- even on the IDE side, I found many things nail biting: in JavaFX or WPF, or Gtk#, I know that the components do align with various containers.
- there is .Net or Java: for people that can afford to pack a runtime with their application (or at least to target .Net 4.0 which is supported from Windows 7 till today), even though the memory consumption of your IDE is definitely bigger, there is no point to not use these tools which are very low cost (or even free), and memory is really not a limiting factor for most of development.

In conclusion: if you want a tool with a very readable language, compiled, native, with low memory requirements that can be bundled on customer machines just as one .exe, Delphi should be considered. If you just want though a readable syntax and you would want that your code to run in everything from Windows 7 till today, I would recommend to look into Visual Basic.Net bundled with Visual Studio Community Edition (which is free of charge). If you want 90% of what Delphi offers, but you don't want to pay any license, look into Lazarus-IDE.