views:

1856

answers:

18

About 10 years ago I bought Borland Delphi, as a child I thought it was the coolest thing ever but I never really got into it. Sometime I see post on SO with a Delphi tag so people must actually still use it. I am curious how does it compare to something like C#? Can it basicly accomplish the same results?

+3  A: 

Yes it can. Also it is natively compiled.

Toby Allen
When you say it is natively compile, does that mean that most other langs are not?
jasondavis
Not necessarily "most" other languages, but C#, which you gave as an example, isn't.
Mason Wheeler
It is a native compiler, means it generates native-code, not managed-code. Microsoft .Net or Sun JAVA are managed code platforms, their codes are compiled into an intermediate language. This code will be compiled on the target machine later.Native code compilers do not need that extra step. C/C++, and Delphi for Win32 are examples of native code compilers.
vcldeveloper
It is also not interpreted, like Perl/Ruby/Python/PHP, which requires no compilation ahead of time, but is much much slower.
BlueRaja - Danny Pflughoeft
Well, virtually every language goes through an "intermediate language" of some sort; it's just that this is often internal to the compiler. And it's not like you have to do anything to invoke this "extra step" when running Java/C# programs -- I still have 2 steps ("compile", "run") -- so I'm not sure what the big deal is. It's not speed: I can point to fast VMs and slow native code compilers.
Ken
It's just a technical distinction, Ken. Also, users don't need to have a VM/runtime installed to execute native apps.
Alex JL
@Ken: But with it being "internal to the compiler", it only happens once when you build the executable. Delphi-compiled apps start faster than .Net apps, especially when the framework hasn't already been loaded on the machine by a prior run or another application first.
Ken White
All of this talk sounds pretty one-sided. You say "only happens once when you build", I say "is optimized for the programmer's CPU, not the user's". You say "starts faster", I say "runtime can't optimize for actual data so will often run slower". You say "especially when the framework hasn't already been loaded", I say "that's exactly the same as C libraries that aren't loaded yet". :-)
Ken
+25  A: 

Actually, C# was created by Anders Hejlsberg, who was the chief architect of Delphi before Microsoft hired him away from Borland. They picked him because what he had created previously was the best solution available for writing Windows apps, and what he made for them came out looking a whole lot like Delphi rewritten in C syntax.

So your answer is yes, if you're familiar with C# you should find Delphi very easy to pick up and become productive with, and personally, I'd definitely consider it a good language to learn.

Mason Wheeler
Anders Hejlsberg wrote a C compiler when he have only 15 years old !
Bitnius
+26  A: 

Yes, I would definitely recommend Delphi as a language - both to learn and to use professionally, if you have a chance to do so.

Delphi and the VCL (Visual Component Library) will teach you very good principles of software design, and making the switch from Delphi/VCL to e.g. C# and the .NET framework (or the other way around) is a no-brainer.

The big benefit of Delphi compared with C#/.NET is the fact you can compile into Win32 native code - native as in : no .NET framework, no Java runtime - nothing like that required. Your EXE will run on top of just Windows - no additional stuff needed.

marc_s
That sounds pretty goood thanks
jasondavis
Couple of points. Why will Delphi/VCL teach you very good principles of software design? Not saying it can't, but you give no reasons. Also, switching from Delphi/VCL to .NET is definitely NOT a "no brainer". I worked at a company using Delphi and it was a big mind shift for them to understand garbage collection, framework class library, assemblies etc. Going from .NET to Delphi is also not simple (allocate/deallocate memory etc). You mention the benefit of Win32 native code so I assume you are referring to the pre .NET versions of Delphi.
Ash
@Ash: in my opinion, the Pascal language is very well suited for teaching programming - less cluttered than any C-style language. Also, with the object-orientation and the whole VCL component model, you're guided into that kind of mindset - reusable code, component-based development etc. The shift from Delphi/VCL to C#/.NET seems much easier (since you're already used to using component libraries and so forth) than coming from VB6 or straight C++ into .NET - that jump seems to be a lot bigger and lot harder to take (in my experience)
marc_s
@Ash: Delphi is still Win32. The .NET side is now with Delphi Prism.
The_Fox
@marc, yes I enjoyed learning Pascal in one of my tertiary courses. As the question is likely to attract people who don't know a lot about Delphi / Pascal, adding the points in your comment to your answer would be good. Also, a "senior" Delphi programmer I worked was surprised and mystified how I wrote a .NET DLL that displayed a User Interface (he had only ever seen EXE's with UIs in Delphi). As I said, at least with the Delphi programmers I worked it was *not* a simple switch.
Ash
@Ash: Are you sure he was a senior Delphi programmer?! GUI in DLL is not something uncommon in Win32 programming, and there are many Delphi programs that use DLL or BPL files with graphical user interface elements like dialog boxes or visual forms.
vcldeveloper
Ash: the switch (tickmark) you are looking for is "build with runtime packages", GUI can then be fully transparanently in dlls. (.bpls).If you don't use runtime packages, you are on your own, but the equivalent under .NET would be to try to create an assembly with GUI that didn't depend on .NET.
Marco van de Voort
+10  A: 

Delphi is used. It has been through some hard times but now it found a new home that takes care of it.

It is a great language to learn. And you still can make great applications with it. There are a lot of external component suppliers, both free and paid.

Another plus, if you have an older version (even V1) you can still upgrade to the latest version. And 2010 is really great to work with.

Gamecat
I agree. Nicely put.
Mihaela
That upgrade sounds pretty nice and unheard of most the time!
jasondavis
Yeah, and unfortunately you're not gonna hear of it for much longer. That upgrade is part of a special offer that was supposed to expire at the end of last year. It's been extended a bit, (I believe until the end of this month), but pretty soon you'll only get upgrade pricing on upgrades from recent Delphi versions.
Mason Wheeler
+3  A: 

Ah the good old days. I remember being relieved that Delphi 2.0 came with a copy of 1.0 so you could still write 16-bit apps.

Anyway, I really like Delphi. It's pretty easy to learn and has a (IMHO) a great IDE and debugger -- things lacking from some of the trendier languages like Ruby. That said, it's clearly a niche platform. Microsoft won the war.

If you're designing something for yourself, go for it. But if you're looking for marketable skills to add to the CV, I'd probably look elsewhere.

Eli
You shouldn't make a blanket statement like that. I got my current job with no C# or .NET experience whatsoever and basically zero C/C++ since college, but a strong Delphi skillset. There are still Delphi jobs out there (my employer is still hiring, among others,) they're just not as highly visible as jobs for more "glamorous" languages.
Mason Wheeler
Same here, we have tons of legacy code written in delphi 5(!) that we maintain regularly. When I was hired I was told we were rewriting all delphi code in c# by the end of the year ... and that was a few years ago. I Don't see it going away anytime soon.
TheSean
Yeah, and if they ever did actually do it, it would almost certainly be a disaster. (See http://joelonsoftware.com/articles/fog0000000069.html ) Skamradt, who hangs around here a lot, has some great horror stories about real-world projects that people tried to port from Delphi to C# that basically vindicates everything Joel warns about in that article.
Mason Wheeler
A lot of big companies have legacy software (legacy in the sense that it's been around forever, not that it's semi-abandoned) that was written in Delphi, and is still written in Delphi. For example, big chunks of Intuit's products are still written in Delphi, and are likely still to be, a decade from now.
DannySmurf
+6  A: 

Why you think Codegear sell 1 million dev tool licenses to Russia !

Hugues Van Landeghem
kemiisto
+3  A: 

I am curious how does it compare to something like C#? Can it basicly accomplish the same results?

Delphi can do everything that can be done with C#, and it will run faster. On the other hand, C# or other .NET languages can say the same?.

Learning Delphi is a waste of time?.

NO. When you learn Delphi, you are learning Object Pascal, the same language used by FreePascal, and knowing it, you can develop for Windows, Linux, Mac, and so on. So the market you could reach is broader than you can think initially.

So, learning another programming language is a waste of time?

Absolutely not, increasing your knowledge will place you in a better position against problems, it will help you find solutions faster, and if you find solutions faster, you'll get better job opportinities and/or ideas to create your own software company.

This also can/must be extended to learning other aspects related to programming, like Databases, Networking, Operating Systems, etc.

Leonardo M. Ramé
+9  A: 

It's the best language out there. Beautiful object model, real pointers. No garbage collection. No multiple inheritance (I take that as a plus). The best implementation of properties paradigm. And it gives you the ability to dive as deep as you need to (ASM). As you may imagine, I would recommend it.

Mihaela
It's beyond me why this list of blanket statements and opinions was voted up several times already. The first sentence especially is flat out wrong, there is no best, "one size fits all" language, there can at most be a best language for a particular task (and even then it's probably subjective, and two developers may well have a different "best" language).
mghie
+10  A: 

We rely pretty much 100% on Delphi for our Client/Server based application. It seems to be very popular for people making desktop database applications (vs both local file and client/server databases). And you can also write Apache filters and DSO for web applications.

In my opinion Delphi is great for the "Entrepreneurial Minded" developer. Indeed you can get an application up and running very quickly (RAD - Rapid Application Development). Not that other programming languages can't do this, but Delphi programmers tend to be people who "just get it done" and not so concerned with using more prestigious, sexy, state of the art languages such as Microsoft and Ruby.

I will 2nd the prior remark that Delphi seems to be very heavily used amongst Europeans and in Russia, and less here in the states.

Lastly, I have been VERY encouraged by the activity of Delphi developers on StackOverflow. At times I would get quite nervous about the "lack" of information/chatter about Delphi on the internet. But as you can see, Delphi is a Tag on SO with many topics.

M Schenkel
"state of the art languages such as Microsoft and Ruby." I'm a bit confused here. A language called "Microsoft"? I doubt that :)
Smasher
I think he means "as [those of]..."
Leonardo Herrera
+8  A: 

The reasons to go with Delphi then are basically still valid, and C# doesn't really change them:

  • fairly long term backwards compatibility (MS trackrecord is not flawless here, where are the ones that went with VB now? Seen any .NET 1.1 runtime updates lately?)
  • standalone exe
  • reasonably fast, with a predicable behaviour and performance.
  • great to build GUI apps.

If you want to go web development, go C#, want to do desktop app development, go Delphi.

Marco van de Voort
Voor web dev weet ik wel iets efficienters...
Stephan Eggermont
MS track record on backwards compatibility is **appalling**
MarkJ
How do you mean? They are **very** reliable in making sure it doesn't work anymore.
Stephan Eggermont
Note that I meant for toolchains and technologies. It's fairly fine for the OS, but less so for the toolchain.
Marco van de Voort
+24  A: 

Jason ---

We are roughly the same age. I bring that up, because people our age don't ever seem to be using Delphi. I started with C# in 2005, because I wanted something I could easily create GUI applications with. I took a VB6 class in college (in 2002), but I knew it was no longer supported and the new product was C#. So I downloaded SharpDevelop (this was before the VS Express editions) and made my first C# application.

I found C# to be rather easy and fun to use. However, 3 of my co-workers were prodding me to learn Delphi. So my boss bought me a copy of Delphi 2006...and the rest is history. It is one of the best decisions I have made in my career.

I was able to write Windows Services with ease, I finally learned how to use the Windows API, and working with the VCL (Visual Component Library) made writing GUI applications as easy (if not easier) than C#.

Learning Delphi finally taught me to understand data structures and real programming techniques. Without Delphi, I don't know if I would've ever learned to use and understand the Windows API.

The benefit of Delphi is that the programs are native (no framework req'd), small, and fast. I can put together an application in Delphi as fast as I can in C# (if not faster). The big difference is that in C#, most programmers don't understand how to accomplish something unless it's wrapped by the .NET Framework.

With Delphi, you are gently introduced to the Windows API (which is what the .NET Framework "wraps up" --- to put it simply).

Don't stop playing with C#, but DEFINITELY learn Delphi. You will be a better Windows programmer for it.

I was mostly a self-taught Delphi programmer, although I did have 3 co-workers to bounce ideas off of. The 2 main sources I used to teach myself Delphi were the Delphi Basics website and the About.com Delphi site (which is an awesome resource for all levels).

I think this beginner's guide (from About.com) is a GREAT place to start with Delphi. Not only that, but once you get through it, make sure you check out some of the other really cool stuff on the site that will make you love using Delphi:

  1. Write a remote screen capture utility with Delphi
  2. Hiding from the Task List, Disabling Task-Switch, Remove From Task Bar, ...
  3. Disable Task Switch, Start Button, Ctrl+Alt+Del ... and much more!
  4. Get Notified When a file gets Created, Renamed or Deleted
  5. Get Notified About Changes to the Attributes or Contents of Registry
  6. A free Network (Internet / intranet) Traffic (download / upload) Monitor
  7. Exchanging Data over the Network using Delphi
  8. Sending / Receiving Record Data and Raw (binary) Data Using TCP Connections

And don't forget to download the JCL (Jedi Code Library) and the associated "visual" components known as the JVCL (Jedi Visual Code Library). You can download a single installation package for the JCL and JVCL here.

One more thing, another great resource if you are new to Delphi is Marco Cantu's free "Essential Delphi" PDF. It is from 2002, but it is a great primer and introduction to the language and IDE.

Mick
Did you learn Delphi from just online resources? I have never used C# yet myself, I would like to try it out but it I don't even know where to begin really
jasondavis
The 2 sources I used were www.delphibasics.co.uk and About.com's Delphi blog...I'll update my comment with this info.
Mick
If I could I would've given this post two up votes as it explains why learning Delphi would be advantageous to you as a developer.
Schalk Versteeg
Excellent post!
Fabricio Araujo
+1 great post:)
Omair Iqbal
+3  A: 

Delphi's advantages:

  • Relatively easy to learn, drag-and-drop gui building
  • Highly forwards compatible. I work on a 2 million line delphi app, and it has been easy to port it forwards across delphi 4 -> 5 -> 2006 and now to 2010. There's no other development platform I'm aware of that has such long-term compatibility.
  • Easiest way of building native windows apps, probably by an order of magnitude. Yes, it's easier than any tool microsoft sells. Delphi was compared more with VB than C++, even though in capability it's close to C++.

Delphi's disadvantages:

  • ObjectPascal's syntax is not for everyone. I've never liked it, even if I can admit it is readable.
  • Pricey
  • No garbage collection. It's as easy as it can possibly get to manually manage memory, but you still have to manage your own memory.
  • No 64 bit support yet (they're working on it).
  • Buggy IDE (at least in 5 and 2006, haven't worked with 2010 yet)
Joeri Sebrechts
The IDE is greatly improved in 2009 and 2010. And most Delphi programmers would disagree with you about "no garbage collection" being a disadvantage.
Mason Wheeler
You're right, but a bullet list doesn't do the disadvantages justice. A couple of those disadvantages are serious problems. For example: pricey. When MS gives away its development environment, there's little excuse for the prices CodeGear charges. You used to be able to get a basic copy of Delphi, in a box, from Futureshop, for $150. Where did that go? No 64-bit support? Really? They're nearly a decade behind now. Buggy IDE - Don't know what the current version is like, but this is one of the main reasons I dumped Delphi nearly 10 years ago. And no improvement since THEN?
DannySmurf
I agree completely about the pricing. Mike Rozlog has said that that's a high priority issue that they're currently working on. I wish there was something a bit more concrete than that, but at least Embarcadero isn't ignoring it. And again, the IDE's quality has been vastly improved in each of the last three versions.
Mason Wheeler
@Mason: would be interested to see a link to Mike Rozlog's comments about price.
Joeri Sebrechts
The most recent comments I'm aware of are from his interview on Jim McKeeth's podcast. Jim hasn't finished editing it yet, but you can get a link to a rough draft from this page: http://www.delphi.org/2009/12/first-dropbox-post/
Mason Wheeler
_No garbage collection_ is not strictly true, at least not in the _C_ sense; strings, records and dynamic arrays are reference counted, as are interfaces if used, and so some of the tedium of manual memory management is lessened.
cjrh
+3  A: 

Sometime I see post on SO with a Delphi tag so people must actually still use it.

Yes. There are some countries where Delphi community is big and still alive. =) Netherlands, France, Russia, ...

I am curious how does it compare to something like C#? Can it basicly accomplish the same results?

That's for sure. Delphi is one of the most mature RAD IDE for Windows. Also you have VCL plus large variety of 3rd party components, relatively easy Databases programming model, ...

But there are some disadvantages:

  • "Faulty visual programming". Beginners tend to mix UI code and application logic. IDE encourage such strong coupling.
  • There is no GC. It's so 90s. =)
  • "Unportability". Suddenly Windows-only.
  • Obscure prospects. Frequent resales, big price, lack of up-to-date free version (like VS Express).

Response to Mick's comments.

Because it's FUD.

And what about this?

Delphi and the VCL (Visual Component Library) will teach you very good principles of software design

I'd definitely consider it a good language to learn

The benefit of Delphi is that the programs are native...

It is a great language to learn.

Why you think Codegear sell 1 million dev tool licenses to Russia !

Not FUD? Simply because they are talking about advantages. But when someone start talking about disadvantages he start talking FUD things by definition. =)

And no GC? Please, then you must criticize nearly every major programming language without GC including C++ and C.

And do you think it's too much for me to do that? GC becomes standard memory management technic not only for application software but for system software too. Please look at Go, for example.

It also isn't "unportable". You can target FreePascal and use the open-source Lazarus IDE and write Object-Pascal on Windows, Mac, and Linux.

It's not Delphi. Did you ever try to port big Delphi project to Lazarus?

Also, Embarcadero has "Project X" on their roadmap, which will bring true Delphi to Mac OS X and Linux.

When "Project X" appears not on paper, then we'll talk. And in the meantime it's FUD. =)

kemiisto
just curious, why the down vote?
Christopher Chase
Because it's FUD. "Faulty Visual Programming" is a criticism of programming style of beginners. And no GC? Please, then you must criticize nearly every major programming language without GC including C++ and C.
Mick
It also isn't "unportable". You can target FreePascal and use the open-source Lazarus IDE and write Object-Pascal on Windows, Mac, and Linux. Also, Embarcadero has "Project X" on their roadmap, which will bring true Delphi to Mac OS X and Linux.
Mick
The poster is comparing this to C#, which is also Windows only. Yes, there is Mono, but when I would want to make a multiplatform app, C# would not be on my list. In fact, Delphi would be a better choice when the multiplatform version is released. Also the lack of a GC isn't really a disadvantage. Besides of that, C# contains much syntactic sugar, and we all know that too much sugar is bad :P
The_Fox
@Mick: I edited my answer in response to You.@The_Fox: comparing to C# as I sad that's for sure that one can accomplish the same results. The disadvantages I mentioned was disadvantages of Delphi "per se" and not comparing to C#.
kemiisto
@Mick: Which other major programming language apart from C and C++ hasn't GC? Say from the first 10 in the TIOBE index (http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html).
mghie
@mghie - Well, you already know the answer to that --- only c/c++. I know how to eat my words ;-)
Mick
@kemiisto --- actually, thank you for updating your comment. You now directly provide support for your arguments...and although I don't agree with the necessity of GC, I think it is nice to have in some languages (like Perl, Python, and other scripting languages...but thats my opinion). I have +1'd this comment now.
Mick
+1  A: 

One of the advantages of previous versions of Delphi (D1-D2007) was its super fast compilation. Give it a 10 million lines of code project to build. It wouldn't take more than 5 seconds to build an exe in most cases! When I started programming in Delphi, I used to think that the project is not compiled at first build and press the build button five more times!

But that advantage doesn't apply in later versions of Delphi(D2009-2010), because they switched to MSBuild system.

However, Delphi is still our programming language of choice. That would continue until C# is able to produce app binary that performs like a Delphi app, and output self-contained native code binary!

Marcus
+2  A: 

Yes, you should.

Here's an explanation of why:

http://tech.turbu-rpg.com/85/learning-delphi-a-true-story

Nick Hodges
+4  A: 

Yes! there is no other easy as delphi. During my collage, I was having hardtime understanding C#, C++ but as my instructors assign project to us and said any language. and i try myself to study delphi and it was so good! my project was the best off all. hehehe I am now delphi adict. delphi is fun for me.

not only that, compiling is fast run independently (no need for .net) easy implementation code structure are easy to memorize it has wide function easy to create your own components

XBasic3000
A: 

There is never any harm in learning anything. Last time i checked delphi is the 10th most popular language in use.

LoudNPossiblyRight
Why? I think Delphi is simply ... excellent (positioning my hands in a particular way).
Andreas Rejbrand
From your other question, it looks like you're still on Delphi 6. That wasn't one of the best releases. And as for what you can do in Delphi that you can't do in C#, you can produce small, fast programs with low memory overhead that don't require any external dependencies. And, Microsoft-backed FUD notwithstanding, Delphi is still more productive than the .NET world. You can build applications faster in Delphi, and they'll end up with less bugs, assuming the developers (on both sides) are competent.
Mason Wheeler
+1  A: 

Lots of opinions... Subjective-C, anyone? :) I usually dodge opinion threads, but after all, it's a question I can answer confidently. To keep it factual, these are its properties:

  • logical and strict syntax and organization
  • closer to 'what you read is what you run' than other languages. No hidden stuff happening, no need to read between the lines or squint and wondering what the code does that you're reading.
  • I've never messed up a pointer in it in my life ;) (been using it since 1999)
  • a debugger that does its job, much closer to the ideal than most other IDEs I've used.
  • the 'interface builder' looks a bit clunky and is a bit behind when creating luxurious GUIs, but sensible and very productive.
  • the help system is one of the best I've used, when it comes to quickly finding topical explanations with helpful links and lucid examples.
  • the end result is an application that is trouble-free, both for ancient and future Windows versions.

As a side note, you can also code c++ inside Delphi, or use inline assembler if you have the need (and will accept the consequences).

There are lots of aspects that you would like to not be a part of a programmer's job, such as cryptic or illogical run-time errors, platform (OS version) compatibility issues, stuff not loaded yet, dependencies, etc. With Delphi, you extremely rarely have to worry about a single of those issues.

If your goal is to quickly write Windows apps (and whatever Linuxes Delphi supports), Delphi makes the path from empty source file to "single file app that works for everyone" very easy and short. If that's your goal too, I'd say go for it!

I'm a big fan of all languages by Mr. Wirth. They are specific, do their job precisely, and the result is a trouble-free, exact app. I still use it off and on after I quit as a Delphi programmer, to code small useful applications quickly for my small company's use.

Henrik Erlandsson