kilde:
http://blogs.codegear.com;quote
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
posted @ 12/3/2006 8:58 PM by Steve Shaughnessy
/quote