I just wanted to ask witch is better Delphi or C#. I didn't wanted C++ discussions here... :(
Printable View
I just wanted to ask witch is better Delphi or C#. I didn't wanted C++ discussions here... :(
sorry i see so much blasphemy i feel obliged to reply =| even tho i don't consider my self active anymore...
first of all i think most of us that posted here know what the "++" operator is in C,
C++ = C + 1, this is to sort the "oh c++ is oop oriented" wrong...C++ is C with oop oriented features and many other. basicly its a version of C.
about c++ being a intruduction language for programming i disagree, mainly because its flexibility...too much :P
there is no ALL AROUND FASTER language...or better structured computer object entity it all depends on how it is constructed that said, if you are looking for faster execution times, less memory consuming and etc...you have to specify in what kind.
is it math computing u want?
is it alogrythm analysis?
is it a sort of IA?
is it easyness of writing?
from there you should choose what language you should use and believe me you got many many options and generally the better one is at one of those points the worse it is in any of the others.
anyways if you really want the best and fastest solution to your algorithm/program you'll have to go into asm optimization but thats way out of the league.
regarding to the topic you can't ask if Delphi is faster then C++ they are diferent languages with diferent ++'s and --'s. unless you specify you question.
i like C++ alot.
@Kingston
Who cares ?
It's about comparing Delphi/C++/C#, not about your programming preferences...
im not to familiar with delphi, so i cant really give any info on that. but with c++ and c#. c++ is more advanced, and is better, but it's also 10x harder to program with(from my exp.) i never really got into it that much, but I have tried.
i use c#, only because it's more simpler, and it gets the job done. i think of c# as a mid level language, has some high points and low.
heh who cares about vb :P i hate that aswell...Fact is, that you seem to have forgotten something.... Ever looked at the newer .net stuff? its starting to really kick ass tbh... you can often outperform a native app because of the JIT optimizations, and hell, you save alot of time developing it in the first place.
Wow, it amazes me the amount of ignorance and dogmatic elitism on this topic. First off, no language is the best, if there was one, what would be the point of using the others? Languages are just like tools in a toolbox, each have their own purpose and function. Would you hammer a nail with a screwdriver? Unscrew a screw with a dremel? I'd hope not.
With that being said, languages are appropriate depending on the constraints of the task. Do you want rapid development? Need a GUI? How about debugging and maintainability? All of these are aspects of the language itself that need to be considered when choosing one.
Of course every programming has their favorite(s), it is only natural. However, imposing that favorite on others so blindly is quite haughty and silly. Again, I wouldn't dare try to write a device driver in C# but I wouldn't dare try to make a complicated GUI application in C++ using MFC/ATL, it's all about purpose and focusing on what is important to you in your project.
Now, for the ignorance part, C# is not that inferior to C++ when it comes to raw performance. It depends greatly on what it is, but most of the time it should be near-exact in performance, possibly a bit less, and possibly a bit more in certain cases where the compiler optimizes things (as many have said). I won't lie, C++ is faster when it comes to raw performance, but that's not the only aspect to look at. Yes, that may be what the user sees most but the difference is not that noticeable in most cases. The .NET framework has come a long way since 1.0 to the recent 3.5 in VS2008.
Now, I have reasons I prefer C# over C++ in most cases, but not all. The main part is rapid development along with the vastness of the .NET framework and the cohesion of it.
First of all, I usually make GUI applications or class libraries (DLLs). GUIs are so much easier to do in C# due to the form designer in Visual Studio and the event driven model that VB uses instead of having to manually hook every control's message pump and get params, convert them to usable forms, blah blah blah. The EventArgs paradigm is much better in my opinion and makes me have to write far less code and do all this in far less time, thus adding to productivity.
The next thing is how classes are written in C#. I really like the idea of doing away with prototypes and .h/.cpp format that C++ uses. It's redundant and unnecessary to me and having the function defined where the code is makes sense. Even more, there are additional keywords such as the sealed, abstract, and internal keywords that help you make your classes more controlled in a design sense. There are other keywords that make things more controlled too, but it would take me a while to list and explain them all fully -- the point here is tighter control on your classes and hierarchies. Remember, not all code is for "users" as much as it may be for other developers to expand and extend upon.
Another issue that some may consider "lazy," I think is good -- garbage collection. The .NET platform really is smart about garbage collection (sometimes a little too smart for it's own good some may say but thats a different issue entirely). Some say that it makes the programmer irresponsible, lazy, blah blah but let's face it, it does get annoying at times when it is a simple case of "new" and "delete" in C++. C# does let the programmer handle it manually if they so wish, so if you really are that into managing it, you still can although it is not recommended (since it is more complex than you may think). This reduces bugs, reduces leaks, reduces overall complexity.
The next thing is how the .NET platform really consolidates a lot of common code you will write and encapsulates them into a more standardized OOP model. For example, anyone that has worked with Winsock knows how that library was thrown together as quick as possible and thrown out with perfection only in the code but not the organization of the library at all. While it works fine, it is hard to understand sometimes and learn but .NET changed that a great deal. Properties you can set easily on sockets, simple method calls, easy async methods, it was just an overall improvement and this just in a single area of the language.
Threading was also greatly improved. I tend to write many async programs (while they may not be very async, it still helps overall flow and responsiveness of the programs if not performance) and I can tell you it is so much easier to use. ThreadPool offers a great deal of flexibility with small operations that occur frequently and you can manually manage threads too. The BackgroundWorker class helps a great deal when it comes to UI responsiveness, alleviating that issue of controls or whole forms becoming the "grey screen of unresponsiveness" during long operations.
Honestly, I could go on and on all day about things why I enjoy writing C# code way more than C++, but it would be a novel at that point. In a nutshell, C# is a powerful language, comparable to C++ in performance but much more standardized. I'm not saying it is "easier" to learn (that may be true to most but not all), as it involves learning different issues. I will say that it definitely reduces the amount of code you need to write for the most part and gives you access to lots of functions without having to find the right library on the internet and learn the APIs for it. Everything is standardized and in my opinion this is a much needed change in the programming world.
The debugger in Visual Studio is also amazing. You can do/find almost anything you could need at runtime and even fix things with "Run-and-Continue" (or whatever it is called) on the fly. It's very helpful and makes things so so so so much easier.
An almost exclusive issue with C# compared to C++ is reflection and "code awareness" as I call it. That means that C# objects and such almost have an awareness of themselves and other objects (of course this comes with a slight overhead). You can called functions by name, reference objects by name, and even compile and introduce code at runtime. How cool is that? It makes scripting so much easier and helps with some database issues too, which is another thing that was really improved upon in .NET.
I'll stop myself short here and say try C#, learn it, make a good few programs and get your feet wet. After you've learned enough of the ins and outs of the .NET platform, come back and tell me what you think. I don't want to hear any opinions without learning it a little in-depth first and especially not ones without trying it. Even better, try making a GUI application in it, you'll love it and say "wow, this IS easier..." I promise.
Haha, RanEnRui is correct. I prefer C# over C++ as well. Mainly because C# is pretty stable and efficient as c++, but C++ is more stable overall. Majority people use c++ for create server side application because of stability. But like he said, depends what you want to do.
overall c# is actually more stable since its managed...duh
What I've read, and please do excuse me if I am wrong, that it does not matter which Language you use, as long as you code it right, you can get the best speed from any language.
As I've just started learning java from the basics, and compared it with a few other coding languages, such as C# and C++, they are all pretty much the same, like boolean, try, catch, int, long, and all those, they are generally the same, right?
I for my own personal opinion would use Java, but that's just because it's the only thing I'm learning now, and the only thing I need right now.
Speed is for 90% dependent of the coder, but for 10% for the language. Languages are good a certain parts, so depending on what project you would do, you should choose a language, for optimum speed.
C(++) is just good at a lot of parts, thats why its the most used language.
But yeah, PHP, C, Java, all looks the same. Except VB, its completely....different. Really, its one big chaos when you program in VB.