Delphi: a secret weapon for Windows developers

Ever since .NET burst onto the scene back in early 2002, Microsoft has promoted it as the primary platform for custom applications. For sure it has plenty of advantages, including automatic memory management, a modern programming language called C#, and a rich class library encompassing both Windows and Web development. The Windows Presentation Foundation, touted as the next generation of the Windows user interface, can only be programmed using .NET.

Unfortunately .NET also has downsides. The first is potentially troublesome deployment, thanks to the large runtime required. The problem has not gone away even though Windows now comes with .NET as standard, since new versions appear regularly. The second issue is performance. Although a just-in-time compiler enables .NET code to run at near-native speed, there is still a heavy memory overhead. The result is that .NET applications generally load and run more slowly than native code equivalents.

The trade-off here is that ease of programming compensates for slower performance. It's true; but not all developers realise that the choice is not only between C# and Visual Basic on the one hand, and the intricacies of Visual C++ on the other. Before turning up as Microsoft's chief architect for C#, Anders Hejlsberg worked at Borland on a language called Object Pascal and a development tool called Delphi. There is some family resemblance, particularly if you include Delphi's Visual Component Library (VCL), which wraps the Windows API with a class library that is equally as capable as the Microsoft Foundation Classes, but much easier to code against. Unlike Microsoft's .NET tools, Delphi compiles directly to native code, and it is feasible to create applications that have zero dependencies, run like lightning, and work on versions of Windows right back to 2000.

Delphi's recent history has been unsettled. Borland delivered some unsuccessful .NET editions and messed with the IDE. The Delphi side of the business was then spun off into a separate entity called CodeGear, which was recently acquired by Embarcadero, best known for database design tools such as ER Studio. Fortunately the compiler remained as good as ever, and the signs are that Delphi's new home will be good for the product. The company has just released Delphi 2009, the first version with proper support for Unicode. A companion product called C++ Builder has the same VCL, but uses C++ in place of Delphi's Pascal variant. These releases also introduce language enhancements including generics and anonymous methods.

Delphi is not the answer to every software problem, and its documentation is poor compared to what you may be used to with MSDN, but in the right context it works like magic. Aside from .NET, every corner of the Windows API is open to it, including services, native code DLLs, COM components, and fiddly software like custom actions for the Windows Installer. The Delphi IDE is once again mature. If you have ever looked with horror at the tens or hundreds of megabytes demanded by .NET for your small Windows Forms utility, or found yourself troubleshooting some obscure problem installing the .NET Framework, Delphi is well worth investigating.

0 TrackBacks

Listed below are links to blogs that reference this entry: Delphi: a secret weapon for Windows developers.

TrackBack URL for this entry: http://www.itjoblog.co.uk/blogadmin/mt-tb.cgi/12

12 Comments

Anonymous Coward said:

I used to write nothing but VB.NET and occasionally C# for Windows desktop applications. That is, until the day I was coerced into using Delphi 2006 for a project.

I haven't looked back. I'll take Delphi over .NET just about any day of the week.

Thanks Tim for the kind words about Delphi!, I agree with you in all the aspects of your article, but want to add a couple of side notes:

1) The second paragraph can be applied to Java also.
2) Reading what you wrote In the third paragraph, one can think Delphi (Object Pascal) is a kind of old language. I must say, ObjectPascal is a first class modern Object Oriented language, very clear and easy to learn.

Leonardo.

Aldo said:

Delphi, easier than VB, almost as fast as C++.

Leonard said:

I am in charge of software support at my company and I also do software development so I always try to write everything to be as easy on IT as possible. One of the major things I have written in Delphi is a business process management program (does document imaging, forms generation, work routing, etc.) for a narrow vertical market. When I go to install it at another site, the IT people always ask what is it going to take to run. Nothing I reply, any reasonably equipped Win 9x to Vista PC is fine. No .NET, no Java and not even Adobe Acrobat (even though it creates, form fills and displays PDFs). Almost everything is built in and in native Delphi. It has a couple of DLLs and one OCX it depends on, but those reside in the application directory and it autoloads them as necessary, no installation is required. They never really believe me until it actually works by just dropping an icon on the desktop from a shared network drive. Delphi allows me to works like I want to, and in ways other development tools can't touch.

Ken Knopfli said:

Whilst Delphi's documentation can never be as extensive as Microsoft's massive documentation set, I have been griping about the bad Help for ages. But I must say the latest D2007 help release was very, very good.

Still needs something for newbies to be able to grab hold of, though. I learnt using the Language Guide and Programmers Reference of Delphi 1-5. These were paper books, but they could easily be updated and delivered as .pdfs

@Leonard: You have hit the nail on the head. Except perhaps for Win9x, unfortunately because of the Unicode change, D2009 no longer supports Win9x/ME. Microsoft's site describes a unicows.dll which, as I understand it, converts API calls to codepage, allowing Unicode programs to run on Win 9x/ME, but I don't yet know how to integrate it.

@Anonymous - delighted to hear people are coming TO Delphi! It really is a "secret weapon".

Meler Magsipoc said:

Long Live Delphi.

Ben said:

I just want to add that the benefits Delphi brings to windows development is also available to C++ programmers, via C++Builder. The VCL framework is the primary power behind the Delphi product and is equally available to C++ programmers, without requiring any knowledge, or use of, Pascal.

We still use Delphi whenever we can for all our development work because its definitely the best. We have experience with C++, C# and Java but would not use these by choice for mission critical business applications on Windows. We have sites that have been running our Delphi built systems for years without any issues.

Gary said:

Delphi lives and I've been a fan and avid user since D1 back in 95.

I still use D7 for most of my development work as I felt post version 7 the IDEs got too bloated and sluggish. As per the other posters comments you can still write really tight small executables with no run-time dependancies. And the amount of 3rd party controls is awesome. I can use a TAdvStringGrid which is very cheap and has better functionality or equivalent to most .net grid frameworks costing several hundreds of dollars.


Gary

Mason Wheeler said:

I've been using Delphi since a friend in high school introduced me to version 1. He saw me playing around with VB and asked if I'd like to try "visual Pascal". I've rarely touched any other language since. I haven't had the need to.

Now I'm working as a professional Delphi developer, on a program with just over 3.2 million lines of code. On my modestly-endowed development workstation, when I hit SHIFT-F9 for a full build, the whole thing compiles in a hair under 3 minutes.

A couple of my coworkers work on a C++ DLL that our program uses, the only non-Delphi code in the project. It's around 300,000 lines of code all told, just under 10% the size of the main EXE. *That* takes just a little bit MORE than 3 minutes to compile in Visual Studio. Oh, and those two are always talking about tracking down bizarre memory-related errors, the sort of thing I never have to deal with, because Delphi's standard FastMM memory manager would catch them for me.

Bones said:

shhhhhh! keep it quiet.

If managers knew how productive their programmers could be with Delphi, they'd all start using it and the market would be saturated with "Programmers" like the dot net market is now. ;)

Leave a comment

Current Vacancies from CWJobs

(* Required field)










Preferred format
   
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4