Gekko Software
Services
Portfolio
Publications
Contact
Blog
About

Introducing .NET (to Delphi developers)

(Revised)

The amount of attention given to .NET is overwhelming, hundreds of books, websites and conferences are filled with information on .net and how to deal with it. Nearly all attention was initially focused on developers with a C++, VB or Java background, the Delphi developer was considered as some kind of alien. While many ideas in .NET are new to C++ and VB developers they had been used for quite some time by Delphi developers.

One of the people behind .NET, and specially the key language C#, is Anders Heijlsberg who had quite an impressive career in the IT industry before working on .NET. Anders used to work for Borland where he created Turbo Pascal as well as it's successor Delphi. After switching to Microsoft Anders created J++ and now C#. What could be a greater compliment to Delphi then the competition employing it's creator ? Microsoft has put an enormous amount of resources into .NET. Before the official release of .net 1.00 Microsoft already had declared .NET a key technology for the future of Windows. So .NET seems to be here to stay.

At this very moment Borland is releasing its Delphi compiler which generates .NET code, making Delphi a full player in the .NET world. The Delphi language has undergone a total overhaul and the updated clx libraries are used to hide the framework from the language where necessary. All of this makes .NET something that deserves attention by every Delphi developer. With Delphi you can target multiple platforms : Linux, classical Windows and .NET. And where .NET goes Delphi can go there to !

What is .NET ?

.NET is a platform, which includes :

  • A runtime system which isolates an application from the operating system : The Common Type System describes data types in one central point. The Common Language Runtime will load and start your .NET application.
  • A large extensible class library build on this CTS and  CLR : The .NET framework class libraries FCL.
  • A number of programming languages which generate code targeted at the CLR and use the .NET framework as class library : Microsoft supplies C#, VB.net, and managed C++.

A Pre Delphi.NET application can target either 16-bits or 32-bits Windows or Linux. Borland has created a class library that is compatible between the OS'es at the source code level. For each target a different compiler has to compile and link application and libraries into an executable. A .NET application is compiled to an intermediate language and does not include any library code. At runtime the intermediate code is compiled into platform specific code and linked to the framework.

The .NET framework will run on all 32 bit Windows except Windows 95. .NET "light" for Windows CE was the first cross-platform implementation. To port .NET to a different platform requires the implementation of the CLR for that platform. There is already work done on a .NET for Linux.

A great gain in .NET is isolating the typing of your variables and the class-libraries used from your programming language. Which also implies that any public class in your .NET applications can be reused by any other .NET programmer. To achieve this level of integration you had to use COM in the "classical" Windows environment. 

The Delphi way

Personally I really do like Visual Studio.NET. I like the user interface where every visual thing has a page in a tabbed book and is not floating around on itself like the Delphi IDE. And I never click unintentionally on whatever is behind Delphi that very moment. To program in VS.NET you have to pick a supported language, in my opinion C# is a very good choice. Officially it is based on C++ and Java. The syntax is something you will have to get used to, in the beginning the most annoying thing is that all names are case sensitive. The good thing is that it is really a new language designed from the ground up to do the things it has to do. This is contrast to languages like Object Pascal or C++, in their original form they did not even include object orientation. You will find C# a very logical and straightforward language. When it comes to the way C# works with objects and interfaces you will feel very much at home. It can be quite amusing to read the trouble it can take to explain things to C++ developers which are very familiar to a Delphi developer.


© Peter van Ooijen. Gekko Software, 2001-2010