22

I'm coming from PHP and Python background with little knowledge of C, I have done many web based application now I'm thinking of Desktop application for windows platform.

A friend told me to go for Delphi and others are saying C# is the best, well, what I'm looking for is

  1. Simplicity
  2. Productivity
  3. Good API documentation
  4. Speed
  5. Drag and Drop
  6. Multi threading & Good Network API

Thanks

Mason Wheeler
  • 82,151
  • 24
  • 234
  • 309
elf1984
  • 337
  • 1
  • 2
  • 4
  • The guy who designed the Delphi Compiler also designed C# language - So C# borrows a lot from Delphi. – Gabriel Apr 14 '22 at 12:28
  • [This book does a thorough comparison of Delphi vs C and C#](https://www.amazon.de/-/en/Ing-Gabriel-Moraru/dp/1709450185). It also looks into things like compiler speed, memory management, cross-platform support, etc – Gabriel Apr 14 '22 at 12:53
  • Some people complain that Delphi is not good documented. The help file is delivered with delphi but you can also find it online. See for yourself: https://docwiki.embarcadero.com/Libraries/Sydney/en/Main_Page . Also, Delphi functions are cleaner than the MS API functions (number of parameters, parameter type, parameter names, etc). – Gabriel Apr 14 '22 at 12:58

4 Answers4

23

Delphi, definitely:

  1. Simplicity - Delphi's syntax is based on Pascal, which was explicitly designed to be easy to learn, and it can deliver on that promise. C#'s is based on the C family, which... well... was not.
  2. Productivity - Delphi is a descendant of Turbo Pascal, and it still has the fastest compiler known to man, which will boost your productivity enormously. Plus it has the debugger Visual Studio wishes its debugger will be like when it grows up. Especially in the latest version of Delphi, debugging is much easier.
  3. Good API documentation - "API" is a pretty vague word these days, encompassing all sorts of things. I assume you mean libraries, and here it's sort of a tossup. Both the .NET framework and the Delphi standard libraries have good online documentation and mediocre, difficult-to-use offline documentation. (A consequence of the Delphi team choosing to use the same horrible help system as Visual Studio, which they will hopefully move away from in the next version.)
  4. Speed - Delphi wins easily. It compiles to native code (faster execution and much faster startup because there's no JIT phase,) and it doesn't use managed pointers so object access is faster and less cache-unfriendly.
  5. Drag and Drop - A built-in feature of the VCL.
  6. Multi threading - Delphi has a built in thread class, but if you want to do complex things with concurrency there are better options. Primoz Gabrijelcic, a Delphi community member, has been working on an excellent concurrency library that I've helped contribute to. It provides high-level support for common threading goals such as task pooling, parallel FOR loops and multi-stage pipeline processes.
  7. Good Network API - Delphi ships with Indy, a mature open-source library that makes Internet connections easy to set up and manage. We use it at work to provide the communications layer for an industry-leading app that you've probably never heard of unless you work in broadcast media.
  8. Deployment - This wasn't on your list, but it's worth mentioning. There are still systems out there that don't have the .NET framework preinstalled. By default, Delphi compiles its standard library into the EXE, then uses a smartlinker to remove parts you don't use, resulting in small EXEs that don't have dependencies on massive runtime libraries weighing in at hundreds of MBs that your users will have to download and install separately.
Mason Wheeler
  • 82,151
  • 24
  • 234
  • 309
  • I love your reply, deployment is one thing i left out (that was a mistake). I was chatting with a friend this morning about the same topic and he told me that, if i`m going to look for a job, i should go for C# anything else Delphi is better – elf1984 Dec 24 '10 at 13:55
  • 2
    @Elf: There may be more C# jobs available, but there are also lots more people competing for them. Skilled Delphi developers don't have any trouble finding work. – Mason Wheeler Dec 24 '10 at 14:36
  • 5
    C# is not based only on C++, but also on Delphi and Java. I too learned programming in Pascal, and I see very much of it's philosophy in C#. Regarding managed pointers you have got that backwards, there is no overhead accessing data through managed pointers, and changing them is faster than in a system using reference counting. – Guffa Dec 24 '10 at 17:20
  • 1
    @Guffa: Of course there's overhead accessing data through managed pointers. Everything's double-indirect so that the GC can move the pointed-to data around without breaking the reference. And not all Delphi data is reference counted. – Mason Wheeler Dec 24 '10 at 18:48
  • 2
    @Mason Wheeler: Your assumption is based on incorrect information. Managed pointers are not double-indirect at all, they are just regular pointers. The garbage collector changes the pointers when it moves the data around. Using double-indirect pointers for that wouldn't even work. – Guffa Jan 10 '11 at 03:06
  • 1
    nevertheless, there is a huge overhead in those cases, Guffa. – Warren P Jun 12 '11 at 03:26
  • 13
    Delphi syntax being easy to learn is a completely subjective statement. I was infuriated by Delphi syntax, and decided against learning it for that reason. – Tjaart Oct 22 '12 at 09:51
  • "less cache-unfriendly" - or alternatively, "more cache-friendly" – Mike Weller Oct 22 '12 at 16:41
  • 8
    -1 : This answer is biased like crazy. The Visual Studio debugger is at least as good if not better than Delphi. Delphi documentation is inexistant compared to MSDN being the best documentation ever. – marco-fiset Oct 22 '12 at 18:08
  • 1
    `Entity().HasId(t=>t.Id);` vs `Entity().HasId(function (t:TTest):Integer begin Result := t.Id; end)` – Niyoko Jan 04 '13 at 07:29
  • 4
    Deployment - total fail. Deplhi requires Windows, so that's a step backwards from C#. C# is portable and multiplatform thanks to Mono. Delphi is not. You don't need to buy Windows to run a program written in C# that doesn't use explicitly Win32 libraries. Simplicity - also failure. C#'s syntax is very easy to read, very concise, and easy to write. Delphi is not. API documentation - hell no! If I write "web service C#" I get tons of relevant results. No such things for Delphi. Speed, threading, especially the debugger - also false. – Alex Oct 29 '13 at 02:45
  • 2
    Funnily the guy who designed the TurboPascal & Delphi Compiler Chain (as well as Object Pascal) also designed C# language. – Aniket Inge May 16 '16 at 11:51
  • -1: This answer wreaks of bias, right from the first line: "Delphi, definitely". No one with any impartial professional knowledge would say Delphi "definitely" is a better option than C#. I'm not saying you couldn't make a case, but saying it's definitely better when I think most people would disagree is a strong bit of blind bias. I'll add also that my personal experience with both languages does not match this answer. – dallin Sep 27 '16 at 20:12
  • @MasonWheeler, Does Delphi supports SIMD (SSE / AVX) Intrinsics? – Royi Feb 17 '17 at 00:32
  • 1
    @AniketInge - the "guy" you mention, [Anders Hejlsberg](https://en.wikipedia.org/wiki/Anders_Hejlsberg), designed not only Turbo Pascal & Delphi, architected the C# language, but also worked on the development of TypeScript. – Reversed Engineer May 28 '19 at 11:23
  • @Tjaart - Is the syntax of a language so important to you to get infuriated by it, EVEN if you didn't intend in the first place to use the language? – Gabriel Apr 14 '22 at 12:31
  • @Gravity that comment of mine was 10 years ago. I can't remember any of the context of my original comment. – Tjaart Apr 15 '22 at 06:27
16

C# generally is going to have a larger user base, more development in the future, and the tools for RAD development through Visual Studio are unbelievable.

  1. The syntax will be similar to that you used in PHP and C.
  2. Visual Studio with its tools and IntelliSense is extremely productive.
  3. MSDN
  4. Again, VS tools + Intellisense, but speed really comes from a familiarity of your language and its features.
  5. VS designer for WinForms, WPF.
  6. System.Threading and System.Net

I do not have much experience with Delphi, and I am just speaking about my experiences with C# in general. Where I work, I have extremely tight deadlines envisioned by non-programmers, and I am able to pump out line of business desktop applications extremely fast. In the last three weeks, I went from specification to deployment on two winforms LOB applications. The productivity for GUI development in C# with VS is just crazy.

bunglestink
  • 2,262
  • 16
  • 26
  • 5
    Thanks, according to a post at http://www.daniweb.com/forums/thread54305.html, Win32 API integration and completness in Delphi surpasses even C – elf1984 Dec 24 '10 at 08:59
  • @Elf: Yes, Lord Soth is right about that. Between the Delphi team and the JEDI community project they've done a great job on WinAPI completeness. And Delphi is actually better at talking to C DLLs in general than C is. (No need for .lib files, for example.) – Mason Wheeler Dec 24 '10 at 13:44
  • 2
    you should really look into Delphi if you think that C# is the ultimate development environment for creating desktop applications fast. I personally hate it when I have to create desktop stuff with visual studio, but nowadays I don't always have a choice (unfortunately). – Wouter van Nifterick Dec 28 '10 at 18:32
  • 1
    Visual Studio's RAD (form design) tools suck, frankly. – Warren P Jun 12 '11 at 03:27
  • 1
    @WarrenP Could you please elaborate? – Tjaart Oct 22 '12 at 09:47
  • I said that a year ago (in 2011) and having had some time to play with Visual Studio 2010, and 2012, I'll rephrase. I hate the way you work with WPF, and WinForms is a dead end. So maybe it's the framework(s) I don't like, not the IDE. – Warren P Oct 23 '12 at 01:01
  • 1
    Create server application in C# and Create desktop application in Delphi, because delphi produces native code which is harder to crack! – justyy Apr 28 '14 at 10:46
  • Can you really and honestly recommend C# when you don't know the other language? Is this a fair comparison? It is like saying that the lemons are the best without every trying the candies... – Gabriel Apr 14 '22 at 12:33
  • Maybe it is time to install Delphi Community edition for 1 month and try it. – Gabriel Apr 14 '22 at 12:35
14

Both have all 6 points you want but I feel C# has the edge on most if not all.

To go through the points:

  1. Delphi requires memory management, so you could argue that alone makes C# simpler. Accepted answer mentions syntax here, well C# syntax is similar to both PHP and Java, so if you want to get up and running quicker from either of those backgrounds, then C# has the edge.
  2. Productivity, I think you get more done quicker in C#. The .net library gives you so much that in the bad old days, I'd have to look to 3rd party delphi components to provide.
  3. Documentation, Delphi's was always good, MSDN is better, plus you will find a larger community for support, see my Stack Overflow anaylsis below.
  4. Speed, Delphi might have the edge on this, but assembly trumps all so that's not usually a good reason to pick a language. One thing I would point out is that I've heard people cite that C# is interpretted. It is not, it never has been, it has always had a JIT.
  5. Drag and drop, available on both.
  6. Multithreading, Delphi is good but C# is excellent with build in constructs like lock(){} parallel extensions, and the new await.

Extra point, the question title is GUI programming, for this I am a big fan of .nets WPF, which, the only thing Delphi had that was half way close was Bold, which was a pain to tame and now dead.

Community size, comparing the number of questions on this and Stack Overflow on both the Delphi and C# tags you will see that the size of the C# community is much larger.

Stack Overflow:

  • Delphi 17K
  • C# 367K
  • Java 312K
  • c 73K

I've added c, to show that's not a problem with the languages age and Java just for comparison.

I'm not a C# or Java fan boy, I was a big Delphi fan, professional pure Delphi developer for 7 years, but they really screwed it up from 2005 onwards with thier ill faited foray into .net which screwed up the stability of the IDE for even native 32 bit compilation. Delphi 7 was peak of the language in my view.

weston
  • 514
  • 3
  • 14
  • How about a reply with that downvote? – weston Oct 22 '12 at 08:49
  • 1
    I am not the downvoter, but I would say that you are not answering the question. Your are just assessing Delphi's popularity on stackoverflow. You sure make a point, but it is IMHO quite minor. Being the only one to use a technology is not always a bad thing. – Simon Bergot Oct 22 '12 at 08:55
  • @Simon fair point, I've now answered all points and integrated the analysis of the number of questions into a wider point about community size. – weston Oct 22 '12 at 09:09
  • It could be argued that language that results in more questions is more complicated to use. ;-) How was Bold similar to WPF? I've used WPF and didn't see any similarities. – Jim McKeeth Aug 27 '13 at 15:48
  • @JimMcKeeth Both Bold and WPF provide a framework to bind data to UI controls so that when the data changes, the UI updates and vice versa if required. – weston Aug 27 '13 at 18:56
  • @weston Ah, OK. You should check out the new live bindings in the last few versions of Delphi. It sounds like what you are looking for. I saw a demo the other day that used live bindings to bind the UI controls to a web service and it even had design time preview of live data. – Jim McKeeth Aug 27 '13 at 19:03
  • @JimMcKeeth Just had a look. Binding controls to `TDataSource`s, erm, isn't that what Delphi has always done! Albeit special data-aware controls. Not saying Delphi isn't progressing, but it's way behind and not sure of its direction, for example I just looked at your site, and I see Delphi for Android now! Another crazy distraction like .net was. Where is the business need for that? It must be "my developers will only program in Pascal, but I need Android". Are whoever owns Delphi this week really going to make money from that?! If I still used Delphi for desktop I'd be concerned. – weston Aug 27 '13 at 20:30
  • 1
    @weston LiveBindings allow arbitrary binding of any object to any object. http://docwiki.embarcadero.com/RADStudio/XE4/en/LiveBindings_in_RAD_Studio RE: Android, there are 900 Million Android devices. There are a lot of people really interested in developing for them - huge business need for that - especially since code can be shared between Android and iOS - better code sharing than any other native development tool (excluding JavaScript and HTML5 tools). – Jim McKeeth Aug 28 '13 at 00:07
  • @JimMcKeeth OK I just looked at that link again, and it starts off saying any Object, but then only objects it mentions are Controls, Components and Fields on Datasources. And those are the only examples offered. – weston Aug 28 '13 at 07:10
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/10352/discussion-between-weston-and-jim-mckeeth) – weston Aug 28 '13 at 07:10
  • Down vote because you say speed is no important when the original question explicitly ask for speed. So, if you cannot reach the grapes, you say you don't want them anyway because they are PROBALBY sour. – Gabriel Apr 14 '22 at 12:41
  • @Gravity thanks for saying you did the downvote. I think you misread. I didn't say it wasn't important. I even said Delphi may have the edge on C#. What I said was... well, you can just re-read it. – weston Apr 15 '22 at 19:36
  • Hi Weston. You did say that: speed is not a reason when selecting a language. Sorry, but it is. For some people/application may be the 1st reason. I have programs that need to process sets of TB of data. Speed (and fine memory management) IS important for those programs. – Gabriel Apr 16 '22 at 13:25
  • @Gravity stop misquoting me! I didn't say it was not a reason, what I said was "...that's not usually a good reason to pick a language.". I find it quite ridiculous that I have to copy and paste this myself because you insist on paraphrasing from memory it seems rather than just looking up. Look, you're not wrong, some rare use cases really need that extra few % of speed but that doesn't mean your whole app needs to be written in old tech like Delphi, or C, or assembly or even new fast tech that is tricky like rust. It's usually only the bottlenecks are worth the effort of going lower level. – weston Apr 17 '22 at 06:19
  • @Gravity and another thing, this answer is nearly 10 years old, parallel computing has come such a long way since. If I had a speed problem on a project today, I know that making it parallel and throwing more cores at the problem is much more preferable to reverting to some lower-level language that might be even 100% faster for example but has worse features otherwise. – weston Apr 17 '22 at 06:27
  • Delphi has more than one release per year. It is not old tech. It is quite on top of the wave. – Gabriel Apr 18 '22 at 18:02
  • It was old when I wrote this answer 9 years ago. And I just had a look and it looks the same as when I last used Delphi 2008 back in 2009, which looked the same as when I first used Delphi 4 at uni in 1998! But way to boil down my two comments into one point. You're good at that. – weston Apr 19 '22 at 04:40
  • I'm getting the feeling this is personal for you, your bio is all Delphi this and Borland that. Here's some free advice, don't get attached to the tools, they all have their strengths and weaknesses and the only bad decision about which tool to use is one that is made before you even see the problem. – weston Apr 19 '22 at 04:49
7

When I was at uni, I was taught programming with Delphi. I am a bit rusty, but I am currently reading through a lot of Delphi code to port it to a C# application.

I much prefer the OO with functional leanings of C# over the procedural with OO leanings of Delphi. You should consider how you prefer to code when choosing between them. I don't think there is much in it when it comes to simplicity - just what you find easier. The same goes for productivity.

In terms of RAD (rapid application development) there is not much between winforms and Delphi GUI design. They remind me of each other.

WPF on the other hand is something I prefer over both for its declarative style.

I don't think there is much difference between the quality and coverage of vendor provided documentation for either C# or Delphi. I think that you will find more non-vendor information about C#, but that could just be because I've not really searched for much in the way of Delphi.

I've not had to do any threaded programming with Delphi, and any networking I did was years ago and I can't remember.

The .NET libraries for parallel processing, events and other threading work are good. So you won't be missing out there. There is a great deal of support when it comes to networking, so again highly recommended.

Overall I would go with C#/.NET. This is partly because of WPF, but also I prefer the code I write in C#. As far as I'm aware delphi doesn't have anything like Linq, which I find invaluable.

Matt Ellen
  • 3,368
  • 4
  • 30
  • 37
  • Thank you for your wonderful reply. which book did you read as a beginner? now i will be starting C# 4 and .NET 4 on VS 2010 – elf1984 Dec 24 '10 at 12:04
  • 4
    Beware trying to port a Delphi app to C#. Every time I've heard of any company trying it, they've ended up validating every point Joel made in "Things You Should Never Do, Part 1" and it ended in disaster for the product and the company that owns it. – Mason Wheeler Dec 24 '10 at 12:34
  • Sorry, I can't really advise you on a beginners book for c#4. I'm not sure I had one when I started c# (back in the 1.1 days. I'm sure there were some, but I didn't read one). When I started I think the first book I used was Teach Yourself C++ in 21 Days by Jesse Liberty, which I read before I started uni. It took me ages to get through it, but I learned a lot. Another good book I had was Discover Delphi, that was the book for the course. A book I recommend is Object Thinking by David West, as it really gets you thinking about OOP and OOD, also Effective C# by Bill Wagner... – Matt Ellen Dec 24 '10 at 12:51
  • ...They're not really beginners book, but once you have the fundamentals then they have great tips and advice on how to become a better programmer. – Matt Ellen Dec 24 '10 at 12:52
  • BTW if you're looking for LINQ in Delphi, check out Alexandru Ciobanu's DeHL library. It provides LINQ-style collections and operators. LINQ syntax (the pseudo-SQL stuff) isn't in Delphi yet, but apparently the compiler team is working on it for a future release. – Mason Wheeler Dec 24 '10 at 15:30
  • what is the biggest Delphi mailing list or forum? – elf1984 Dec 24 '10 at 15:48
  • @elf1984: Probably the official Delphi forums at http://forums.embarcadero.com. Also, if you're interested, check out http://www.delphifeeds.com. It's an aggregator site that follows a bunch of Delphi-related blogs and also the most popular newsgroups. – Mason Wheeler Dec 26 '10 at 14:38
  • @Mason Wheeler: Thankfully we're not porting the whole app, just a few choice functions. I take the point though, even this is hard and error prone. – Matt Ellen Dec 27 '10 at 18:10
  • What about C# on Linux (native support)? – Gabriel Apr 14 '22 at 12:39
  • What about processing TB of data (data mining) in C#? Would you even start a program to do that? – Gabriel Apr 14 '22 at 12:40