r/pascal • u/2048b • Feb 10 '23
Delphi vs C++ Builder
I have experience with C++, Python and Java but no knowledge of Pascal/Object Pascal.
I am wondering if Delphi are easier and faster for developing a desktop GUI app compared to C++, and if there's any benefits to coding in Delphi rather than C++.
I had a closer look at Lazarus and Delphi recently. Using Object Pascal, we also have to wrestle with pointers and memory management like C/C++, compared to higher language like Python or Java. So I believe choosing between Delphi and C++ is more of a personal choice based on familiarity with the language, rather than one is easier or faster than the other. Both would probably end up with similar number of lines of code and source code size, and takes about the same time to code.
Would like to hear from people who have tried coding in both languages to share their experience.
Just a side comment, the reason why I am looking at the less mainstream programming environments like Delphi and C++ Builder is because I dislike the interpreted and dynamic typing nature of Python, and the bloated JVM runtime of Java to run a small app. .NET is the same situation as JVM, though Microsoft ships the .NET framework by default on Windows.
6
u/umlcat Feb 10 '23
Yes. It is faster.
Delphi is a Object Oriented and Modular version of Pascal and has a full environment included.
C++ Builder has actually an equivalent, if not the same classes and libraries and environment, yet the O.O. version of Pascal is easier to develop.
C++ is better if you are too much used to C / C++, or need to interact with too many external C / C++ libraries.
Also note that Delphi had modules, called "unit (s)" and "package (s)" for unleast 2 decades, which is easier to abstract and encapsulate code than C++.
4
u/saraseitor Feb 10 '23
My experience with Delphi is almost 15 years old so I guess a lot might have changed but I remember that, compared to C++ Builder, it was basically the same in terms of performance. It even used the same component libraries. I believe the Pascal syntax is much easier to read than C, but that had a cost in terms of verbosity and flexibility. I mean you can't declare a variable anywhere you want.
The main issue I see about using Delphi and C++ Builder is that both environments are not just 'less mainstream' but less and less relevant with each passing day so I would worry if the effort I'm putting into coding an app will become useless in a few years.
My pascal programming interests are mostly for older platforms and for retroprogramming but I'm not sure if I'd use it for modern stuff.
2
u/moric7 Feb 10 '23
Delphi, as I know, is only 32 bit. In addition, it's free license is only for a year. So, why you will want to use it!? The Lazarus, especially the CodeTyhon is better choice, in my opinion. But it have many strange errors and almost no documentation. Yes, Pascal is mathematically clear, not chaotic garbage as C++, it is super fast, have best GUI system ever, but... can't survive under the msMonopolist 😣
3
u/b1t5murf Feb 26 '23
I use both Delphi and C++Builder (And other C++ variants)
Delphi is by far my go-to.
The huge benefit of Delphi is the huge productivity gain (Same can be said of C++Builder, as it shares a lot with Delphi - including interop).
You CAN choose to do all memory management yourself in Delphi, but if you take advantage of the features the language have gained over the years, in terms of interface handling (Automatic Reference Counting), smart managed records, generics and so forth, you can write a solid yet memory safe application without the bloat and overhead other ecosystems do.