views:

356

answers:

4

It has to make some time consuming calculations, so i need it to work as fast as possible.

Also thought about Delphi. So. Is it a question of taste(or habit) or not and what can you advice me then?

+16  A: 

The choice is simple. Delphi, hands down. C++ has the high-powered calculation ability you need, but no good GUI builder. VB's got a good form designer, but good luck getting high performance out of it, in either VB6 or the .NET version!

Delphi compiles to very efficient native code, and even includes an inline assembler if you need to tweak your calculations at that level. And it has a very easy-to-use form designer. As long as you only need to compile support Win32, Delphi's the obvious choice. (And that restriction's looking like it's going to change soon, from what the Delphi team's been saying lately...)

Mason Wheeler
+1: you can always recompile it using Free Pascal and Lazarus and have it portable ;).
Kornel Kisielewicz
C++ has C++Builder :)
Moritz Beutel
@Kornel: How stable is this Lazarus framework?
Jeroen Pluimers
Stability is generally ok. The problem of running into missing functionality is a bigger problem. However this depends extremely on the case.
Marco van de Voort
A: 

I have to disagree with Mason. If you're writing a Windows GUI application that needs to execute fast, and be easy to build, C# is the way to go. With .NET 3.5 you can get very fast calculations through the .NET runtime and it has great form editing support. Furthermore if you have experience with C++, C# is very easy to pick up.

Another added benefit of C# is that if you find down the road that your calculations are too slow, you can always write the computationally expensive code in C++, wrap it in a DLL, and call it from C#.

All in all C# beats anything else at quickly building Windows applications without sacrificing too much performance.

As a last statement I'd like to say that I am not paid by Microsoft, I generally hate managed languages, and to this day I avoid writing C# whenever possible because I prefer C++. That said, the usefulness of C# has made me a believer in using it for anything that either needs to be done quickly or needs a user interface, because fiddling around with MFC, WTL, ATL or COM totally sucks.

Chris
If the choice were C++ or C#, I'd agree, but Delphi pretty much does exactly what you listed, but generates the native code straight away, and you don't need to go the DLL route if you need more performance - you can just write the method in assembly language in the same file you had the original method in. Even COM is fairly easy to work with in Delphi, IMO.
Michael Madsen
+1: Because why the heck is someone getting down-voted for saying C#?
Hogan
Just out of curiosity, have you tried Delphi? C# is basically Delphi rewritten in C syntax, in managed code. (Two big steps backwards.) Delphi also lets you do GUI design intuitively, with no MFC or any of the rest. It uses the VCL (Visual Component Library), a mature library which wraps the Windows API directly. And, as I noted, it compiles to native code, which will always beat out managed code in performance except for a few edge cases.
Mason Wheeler
"C# is basically Delphi rewritten in C syntax." No, it's not. C# took a few ideas from Delphi (notably bound method pointers aka delegates), but C# took ideas from all over the place! It's confusing and misleading to describe it as "Delphi rewritten in C syntax."
itowlson
Actually there's more Delphi in there than you think. Not surprising since Microsoft brain-drained the chief architect of Delphi and a bunch of team members to create C# and the .NET framework.
Mason Wheeler
I have worked with Delphi several times, and I generally find it to be an ok environment. That said, I still prefer C#. I'd also like to point out just because code is native doesn't mean it is fast. The honest fact is I have more faith in Microsoft's compiler division than any other compiler writers except Intel and IBM. And I have never seen any metric that would make me believe it is slower then Delphi considering a lot of metrics show C# favorable to C++. Last note... This post has become pretty nasty. This is the first time I've ever been down voted for an opinion. That's brutal.
Chris
First time getting downvoted? Then you're doing all right. Most people get a lot more upvotes than downvotes, especially if you stick around for a while, but eventually you'll say something that other people think doesn't help the discussion or is just plain wrong. Please don't take it personally. We're mostly just trying to guide the people who ask questions to the answers that will be the most help in solving their problems. :)
Mason Wheeler
No downvote, but I'm reluctant to use c# (or any .Net language) for UI development. Between the performance hit on startup, slow Winforms painting and heavier memory use compared to native code, I think it's much better suited for server side apps.
Bruce McGee
Deployment of C# can be problematic too.
Marco van de Voort
@Chris: I'm sure you wouldn't have been downvoted if you stated your sentences as an OPINION. But you say stuff like "All in all C# beats anything else..." ... that doesn't sound like an opinion to me and is therefore misleading.
Smasher
*And I have never seen any metric that would make me believe it is slower then Delphi considering a lot of metrics show C# favorable to C++* http://dada.perl.it/shootout/matrix.html
cjrh
+26  A: 

Let's try to analyse them:

C++

Pros:

  • Generates native code, so it's fast.
  • Allows very low-level access to go all out in optimizations.
  • Can be highly cross-platform.
  • More prone to unreadable code. (Personally, I think that the fact a utility like cdecl even EXISTS, is a good sign that parts of C is not meant to be readable - and since C++ is mostly a superset of C, the same applies here.)

Cons:

  • You need to manage a lot on your own, which can easily introduce memory leaks and the like if you aren't careful to get all of this managed somehow (smart pointers, for example).
  • Compiling is sloooow.

Delphi

Pros:

  • Fast compilation.
  • Generates native code with no runtime dependencies by default.
  • Allows you to easily integrate low-level assembly if you want to.
  • You generally don't need to mess with pointers, but you can if you want to.
  • Very nice GUI builder, and the VCL is a nice toolbox which serves most of your basic component needs.
  • Delphi code is generally pretty easy to read.

Cons:

  • Delphi isn't as widespread of a language, so references might be a problem.
  • If you need to interface with external DLLs, you're less likely to find finished Delphi code that allows you to call the DLL methods; you are more likely to need to write the required declarations yourself (there are tools, apparently, but I don't know how well they work...)

VB6

Pros:

  • There are still a LOT of references out there.
  • Let's face it, while we may not like the language, it is pretty easy to read.

Cons:

  • Extremely outdated environment.
  • Not supported anymore.
  • Not suitable for code needing to be overly efficient.

VB.NET (C# as well)

Pros:

  • Due to the architecture of the .NET framework, you could theoretically get more performance, because it is able to optimize the code for the specific CPU it's being run on.
  • Gigantic library at your disposal (.NET framework).
  • Memory is pretty much managed for you. That means it's a lot harder to mess something up there.
  • Popular languages, so lots of references out there.

Cons:

  • Memory is pretty much managed for you. This means some performance aspects are out of your control.
  • You can't really drop down to low-level assembler code, because it's compiled to an intermediary format. Sure, you could implement your own method in IL, but there's usually not as much to be gained as with assembler.

My personal vote goes to Delphi, because it lets me build fast applications quickly, and the latest releases have really improved on the feature set and the usability of the IDE.

Michael Madsen
+1 : Now this is what I call a "complete answer" :D
Kornel Kisielewicz
C++, compiling is sloooow......or lack of options.
lsalamon
Thanks alot for the answer. Have chosen Delphi due to simplicity. .NET wasn't an option from the beginning - the app is going to be small, so downloading the whole .NET Framework would be a great headache for its users.
just_cause
+1 for Delphi, Go Delphi Go.
RRUZ
It's pretty biased to claim that with C++ one would have to manage a lot on their own, and don't claim the same for Delphi. Actually, if it's modern C++ code (RAII, smart pointers, STL are used) I'd say this is actually a bigger problem with Delphi than with C++. C++ has objects on the stack, which get freed automatically, Delphi has only references to instances on the heap. That being said, IMHO it's neither a real problem with C++ nor with Delphi, it just is, and you have to program accordingly.
mghie
The tools "help", but are not blind click and ready.
Marco van de Voort
A: 

If you have worked in a language before that is the best choice. The time to learn a new environment is long compared to the gains for most language in the short term.

That said -- if you plan on working in an environment for more than, I don't know, a year then it makes sense to learn a new one.

Hogan