Delphi versus C++ Builder - Which is Better Choice for a Java Programmer Doing Win32

MB. picture MB. · Oct 7, 2008 · Viewed 13.9k times · Source

I'm a pretty experienced Java programmer that's been doing quite a bit of Win32 stuff in the last couple of years. Mainly I've been using VB6, but I really need to move to something better.

I've spent a month or so playing with Delphi 2009. I like the VCL GUI stuff, Delphi seems more suited to Windows API calls than VB6, I really like the fact that it's much better at OO than VB6, and I like the unit-testing framework that comes with the IDE.

But I really struggle with the fact that there's no widely-used garbage collector for Delphi - having to free every object manually or use interfaces for everything seems to have a pretty big impact on the way that you can do things effectively in an object oriented way. Also I'm not particularly keen on the syntax, or the fact that you have to declare variables all at the top of a method.

I can handle Delphi, but I'm wondering if C++ Builder 2009 might be a better choice for me. I know very little about C++ Builder and C++, but then I know very little about Delphi either. I know there's a lot to the C++ language, but I suspect it's only necessary to know a subset of it to get things done productively... I have heard that the C++ of today is a lot more productive to program in than the C++ of 10 years ago.

I'll be doing new development only so I wouldn't need to master every aspect of the C++ language - if I can find an equivalent for each of Java's language features I'll be happy enough, and as I progress I could start looking at the more advanced stuff a bit more. (Sorry if that sounds painfully naive - if so please set me straight!)

So, for a Java programmer that's new to both Delphi and C++ Builder, which would you consider to be a better choice for productive development of Win32 exes and dlls, and why? What do you see to be the pros and cons of each?

Answer

Roddy picture Roddy · Oct 11, 2008

Delphi or C++ Builder - it's a difficult choice!

As you're aware, they're basically very similar, from the IDE and RAD point of view.

The pros and cons of each - irrespective of background - are a bit like this. Both share a great 2-way RAD form designer and framework (VCL) that are ideal for native Windows development.

Delphi:

  • FOR: Large, active, enthusiastic community
  • FOR: Delphi 2009 is the best version for many years
  • FOR: Delphi "units" make C source/header file pairs seem archaic
  • AGAINST: No automatic destruction as objects leave scope, hence lots of 'finally's in your code
  • AGAINST: Language can be 'wordy', which is a matter of taste
  • AGAINST: Using third-party DLL's or libraries in other languages (esp. C) requires Delphi header files to be written

C++Builder

  • FOR: C++Builder 2009 is probably the best version ever
  • FOR: RAII idiom simplifies memory management hugely
  • FOR: Templates are incredibly useful and powerful, even if the C++Builder implementation has some bugs with them.
  • FOR: Support for BOOST and other modern template-based libraries (even though the Boost support is not 100%)
  • FOR: Great interop with Delphi means most Delphi components can easily be used.
  • FOR: Easy to use with third-part DLLs/libraries with C/C++ headers.
  • FOR: C++ may look better on a CV than Delphi.
  • AGAINST: CB2009 is "unicode only" - the implications of this for code portability are different and less well thought-out than for Delphi
  • AGAINST: C++Builder user-base is much smaller than Delphi. Maybe 20% or less.
  • AGAINST: Borland/Inprise nearly killed BCB a few years ago, and it was only resurrected after major efforts from the community. (However, Codegear/Embarcadero commitment does seem impressive)
  • AGAINST: C++Builder is not top of the pile within Codegear.
  • AGAINST: Third-party component vendors don't always understand/support C++Builder

That's about it. Just to state my position, I'm a happy BCB2007/2009 user (since BCB5), and I also infrequently use Delphi. A few years back, I considered a switch from C++ to Delphi, but the lack of RAII idiom was the one thing that I found difficult to come to terms with.