English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories
3

I am gonna start learning. So please suggest me the best one. Which one is the best, C# or C++?

Thanks

2007-02-16 06:25:50 · 4 answers · asked by farooqaaa 1 in Computers & Internet Programming & Design

4 answers

I doesn't matter WHAT you want to do. They are both capable of the same tasks. C++ is a lower-level language than C#. But C# has its own built-in garbage collector/memory management system, so you don't have to deal with pointers and accidental memory leaks.

I am advanced with both C++ and C#, and I use C++ when writing a game engine. That's because C++ has libraries like OpenGL and DirectX.

C# has libraries for those APIs as well, but they are wrapped around the C++ libraries.

With C#, I find it MUCH easier to develop a user interface, using Windows Forms, to develop database applications, and much more. C++ is capable of the same thing, but C# is much quicker as far as development is concerned.

But if you're looking for speed (performance-wise), I'd say go with C++. C# is part of the .NET Framework. When you create, for example, a Windows Forms application, it has to load the .NET Framework. Therefore, the applications use more memory as well, and they load slower.

But if you're looking for easy/rapid development, I'd say go with C#. But if you want to learn game development, I'd say stick with C++.

And the concepts behind C# and C++ are different. They syntax IS very similar. But C# is object-oriented, no matter what you choose to do. With C++, your app. can be object-oriented, but it isn't "forced".

So take all that into consideration, and decide which would be best for you.

2007-02-16 06:50:13 · answer #1 · answered by the_dadd_from_tn2005 4 · 1 0

The best for what??
The basics are similar: the syntax of the two languages are almost identical until you get into some advanced programming contexts. Either one will help you. The emphasis will be on when you get to the advanced levels: C# is a little easier with memory manipulation, however I find that C++ has more library add-ins for more complex work (like mathematical libraries).
Determine what you want to programs to do, then re-ask the question.

2007-02-16 06:32:39 · answer #2 · answered by sewie_123 1 · 1 1

I say start with C++, this will give you a better understanding of what's going on underneath the hood. Most likely, in time you will prefer C# because the .net framework provides a lot of existing programming resources for you, and it's quick to develop an application. Starting with C / C++ is better though, because I've seen many ignorant programmers that know Java / VB.net or C# really good, but couldn't program their way out of a paper bag when it comes to being clever.

2007-02-16 07:40:20 · answer #3 · answered by Pfo 7 · 1 0

As far as learning a new language, these aren't the best to start off with. I'd recommend a flavor of BASIC or perhaps a scripting language like Python or Lua before you get into the higher-up languages (like C/C++/C#/Java).

Provided you've already some concept of programming (ie have already coded in BASIC or some other simple language/scripting language (HTML counts as a scripting language in my book. I don't consider it a programming language since it doesn't provide stand-alone programs (something I tend to require in my definition of a "programming language")), I'd start you off with C#. Despite the lack of help and continual evolution of it (and the fact that it's a Windows-only language), I really think its syntax is clearer and more concise than C++.

C++ came from the old days of extreme control requirements. As our computing power has increased exponentially since those days, C#'s memory management abilities (among other things) make it a more suitable language. Sure, it probably wouldn't be in your best interest to program a massive game in it (as C#'s memory management, et al, come at a huge processor overhead price (relatively speaking)), but it should be good enough to introduce you to the syntax of the C family and error-proof enough that unless you knew what you were doing, you'd find it difficult to trash your computer with it.

Oddly enough, I consider C#'s lack of libraries to be a benefit. Although it'd take you a long time to program something in the language (without specialized libraries), it helps that you have pretty much only Microsoft-approved libraries and functions, meaning that you couldn't accidentally import a joke library (or worse, malicious library) that might destroy your computer (it happens from time to time).

Finally, its deep ties with the .NET framework mean that if you get stuck on something important (ie can't move your program on without it and have an impending deadline), and you know another of the .NET languages (say, VB), you could easily code that section in VB and import it into your project at compilation. Better yet, when you decide to move on to C++, you can use Visual C++.NET's integration to reverse the process (ie when learning something new in C++, look back to your C# experience and tweak it a little, or import the C# code into your project at compilation if you're on a deadline).

So, I'd go with C# if you're starting out. If you don't have the latest .NET package (or any at all), just download the Express versions (although they lack the cross-integration of different languages) and mess around in them. Then when you want to do some serious programming (although 90% of all possible tools are included in the Express Editions), go with .NET (latest one out) Professional (Standard isn't good enough by my standards, but consider it if price is an option).

2007-02-16 06:54:35 · answer #4 · answered by earl71972 2 · 0 2

fedest.com, questions and answers