Learning Delphi
I recently made a passing comment on our Delphi database field test forum about my recent experience of learning Delphi. I was quickly asked to blog it. So here are some quick notes on my experience learning Delphi. A little background first though. I started my software career writing in c and some assembly, using make and vi. While at Borland I moved on to C++, Java with JBuilder and Eclipse and a little bit of c#. In my 17 or so years at Borland I had never developed in Delphi. For the past 10 years I have been doing most of my development in Java. I started developing in Delphi last May.
Learning Delphi has been an interesting experience for me. Initially I thought the different syntax might be a bit of a hassle. Its easy for a developer to unnecessarily get hung up on things like editor key bindings and programming language syntax. However, Delphi syntax isn’t really a problem for me. Sometimes its actually an improvement. For example, the notion of a “Result” variable for return values can come in handy when writing function logic and the property syntax makes for elegant, easy to read code. At the end of the day the more important issue to me is the ability to create object oriented abstractions. Delphi’s support for single inheritance, delegates (events) and interfaces is powerful and straight forward. Records (value types) can be especially convenient and efficient for non-gc based memory management. Delphi’s reference based objects with fields that are set to nil on creation are efficient and less error prone.
Packages, units, interface/implementation sections were a little different from what I was used to. These features do help to provide good structure and encapsulation for Delphi applications.
I remember years ago that Anders Hjelsberg was giving me a demonstration of a new “override” feature for virtual methods in Delphi. He explained it more than once I think because I was not showing enough excitement for the feature. At the time I was working in Java so it wasn’t something I was going to get to use anyway. Now that I am developing in Delphi, I really like this feature. Without the override key word, implementing virtual methods through inheritance is more error prone. Sometimes it’s the little things that make all the difference.
The Delphi compiler itself is lightning fast. Sometimes I compile twice because I’m not sure I actually hit the compile key.
The Delphi naming conventions for classes, fields and parameters kind of make me laugh – in a good way. I remember when I was working in the JBuilder team in the early days of Java that the Delphi guys would come over and say: “You know, you really should put a “T” in front of your classes, and an “F” in front of you fields”. Well that wasn’t really going to go over well with the rest of the Java world. However now that I am working in Delphi, I never have to worry about how to differentiate that names for parameters, fields, classes, and objects instances. Its simple, it works, and it is expected by the rest of the Delphi developers in the world.
Another aspect of Delphi that has been very interesting to me is the ability to write software that runs in both native and managed platforms. I don’t know of any other development environment that comes close to supporting this as well as Delphi. I like this idea of the delphi language/rtl/vcl being a "super platform" for win32/64, .net, .net cf. Of course going forward Delphi could become even better at this. I have had to factor out platform specific code into separate units and use some ifdefs. “Single source” may or may not be a big benefit for the Delphi community at large. However, I like leveraging this feature so that we can provide similar or identical features for both the native and managed platforms that we support.
There are things I see missing and some things I don’t like in Delphi. However almost all of these are correctable and the team already has plans to address many of these in future releases.
Well I’ve only scratched the surface of Delphi. Overall I have really enjoyed developing software in Delphi. Its well suited to rapidly developing large scale, high performance, object oriented software.
-Steve
Share This | Email this page to a friend
Posted by Steve Shaughnessy on December 3rd, 2006 under Uncategorized |

RSS Feed

December 4th, 2006 at 2:25 pm
Thank you for the post Steve. It is always interesting to hear what long time developers using languages other than Delphi think of Delphi, especially its language.
Something else that might feel a little different is how Delphi implements namespaces. People are not used to Delphi truncing the last element in a unit name. Makes for namespaces to appear odd in C#.
For instance, classes declared units named MyCompany.Windows.Utils and MyCompany.Windows.Forms will all appear in the same namespace, MyCompany.Windows, which may not be what the developer wanted. Just add a trailing name like Default or something else and the classes will appear properly categorized in C#. Ex: MyCompany.Windows.Utils.Default
December 4th, 2006 at 5:37 pm
I didn’t touch on namespaces and pascal units. In my short experience these two notions of namespace don’t mix too well. As you mention, c# doesn’t see the unit, just the namspace. This is also a bit of a pain for me because I like to write single source code that can be compiled for both managed and native platforms. Following the pattern used by others, my single source code has a single word unit. For .net, the namespace is added at compile time. If you are just developing for .net its not as bad. The current solution is workable, but not that straight forward to me. I wish there was a better solution for this, but I have no idea what that would be.
December 5th, 2006 at 4:24 am
Great post. One of the best i’ve seen about a Java developer commenting Delphi. Here in Brazil, Java devs. ‘hates’ Delphi. I am sure they don’t know delphi at all to act like this.
December 5th, 2006 at 12:29 pm
I enjoy developing in both Delphi and Java. I suspect people that "hate" Delphi probably have not done that much with it. Before deciding to join the Delphi team I knew of many very talented and skilled developers who swore by the productivity of Delphi. I wasn’t disappointed. The bottom line is that you can’t argue with success.
-Steve
December 7th, 2006 at 2:50 pm
Thank you for that Steve, it was an intersting read.
It still surprises me the number of times people in the C/C++/C# world still introduce bugs like:
if(something=passedValue) {
// Do something here
}
It is often their education that = is equals, not assigned. I do like the differentiation Delphi provides with simple things like this, but the number of times you see this bug, or similar is quite silly.
I must admit I still prefer the Pascal language for readability and maintainability, but all those other points you mention are greatly appreciated (albeit we’ve probably taken them for granted these days).
December 11th, 2006 at 9:30 am
The Delphi language allows fast, readable and almost bug free coding. It is the best asset CodeGear have - perhaps you should break tradition and tell your marketing people…
December 13th, 2006 at 9:40 am
Given your unique perspective, I’d really like to hear the things you didn’t like and what is getting addressed
December 14th, 2006 at 11:15 am
I’m sure my path through Delphi may not be the most common, but here’s a list of language/rtl/vcl related improvements I’d like to see. I’m not going to provide exact time frames for when or if these will be addressed.
1) Reference counted Unicode strings. This is at the top of my wish list.
Codeguard for Delphi. I do have to work on some c++ code and codeguard for c++ has helped me find bad bugs sooner. Although it is easier to shoot yourself in the foot with c/c++, Delphi could still benefit from this.
2) Better compiler errors/warnings. Many of these are fine, but there are a few here and there that as a new user I found confusing. I try to add them to our BTS when I hit them.
3) More .net/native RTL portability. A lot of this requires adding more features to the native side. Things that I ran into include the need for more native collection classes (ie hashtable), StringBuilder, ByteBuffer class, and a more multithreading support in the rtl.
4) More single sourcing of the vcl. This makes it easier to maintain and add features that work for both managed and native code. This is not really feasible for rtl "implementation" which is closer to the metal, but the db related vcl could certainly benefit from this approach. We are already working on some single sourcing for our next release.
5) The ins and outs of static, dynamic and open arrays were too subtle for me. I’m not sure what can be done to improve this now though. There aren’t that many stumbling blocks in Delphi, but it might be worthwhile to have a “top 10” for new Delphi developers.
6) I’ve never seen anything like Move and Fill. They take the effective address of the argument you pass in. Because I had a c/c++ background I thought I would just pass a pointer in. Not good. Perhaps it would make sense to have a compiler warning when an application attempts to pass a pointer to these methods.
7) I’d like to treat strings and dynamic arrays as objects even if they are not actual objects. It would be nice to have code insight available to show me the methods/properties available. I don’t like having to look up the global string functions.
December 14th, 2006 at 6:49 pm
I have been working with Delphi for 3 years and I like Delphi. But my boss wants me to turn to VS2005 because Borland gave up Delphi.
December 14th, 2006 at 10:34 pm
Hi MIles,
Todd Nielsen has made it clear that he wants to do the "right thing" for Codgear customers, products, and employees. I can tell you from personal experience that the future for Codegear customers, employees and products looks brighter today than it did before Todd joined Borland.
Please let your boss know that Delphi continues to be a successful and profitable product. The Codegear management team has shown absolutely no signs of giving up on such a viable business. Codegear has a competent, fully staffed development team working hard on the next release of Delphi.
-Steve
December 18th, 2006 at 1:33 pm
Great post. Keep Delphi going strong. I love it. I also come from a background of using different languages (mainly Java). I’ve only just started using Delphi but I think it’s awesome. I wish I started using it earlier.
Best wishes.
Eddie
December 18th, 2006 at 2:52 pm
Steve
bde with d1 worked, 32bit was crap
our future with dbx4 lies in your hands
please make it work lightning fast again
thanks in advance
mullah
July 13th, 2007 at 3:06 pm
Thanks 4 ur comments it’s always encouraging 4 someone starting to programm in delphi.
Thanks!
August 12th, 2007 at 10:31 am
i want to take learning delphi book for development to scada system
August 17th, 2007 at 1:00 am
Thanks for helpful article.
All the best.
August 26th, 2007 at 6:05 am
I’m control engineeer in syria
August 26th, 2007 at 3:49 pm
Waduh pada ngomongin apa nih, kagak ngertos saya. He..he..he..he..
September 2nd, 2007 at 2:08 pm
very interesting.
January 16th, 2008 at 8:15 am
Thanks for the nice read
March 1st, 2008 at 4:53 am
dank u veel
March 1st, 2008 at 4:54 am
thanks
March 1st, 2008 at 4:54 am
thanks
December 28th, 2008 at 1:33 am
Thanks for article.