Sign in to follow this  
TheMirror

C++ and C# Question

Recommended Posts

Hello everyone, I was wondering if anyone could tell me the difference between C++ and C#, and if you could kind of go over what C# is mainly used for? Thanks a lot, I appreciate your time and answers. Sincerely, Ross

Share this post


Link to post
Share on other sites
These threads usually attract the fanboy squad and start a good old language flame war. I use both C++ and C# however I'm not advanced yet in these languages.

C++ is a lot harder than C# because you need to do a lot of things yourself, it's a low level language.

C# is easier for new programmers because it's a high level language and has some things done for you such as the garbage collector for un-used objects to free memory.

http://en.wikipedia.org/wiki/Low-level_programming_language
http://en.wikipedia.org/wiki/High-level_programming_language

Low level languages are harder than High level because you need to do a lot of things yourself.


If you're asking what you should learn first, I suggest C# only because C++ needs a lot more time to learn and might be harder to most people making it discouraging to learn programming.

Some more links:

C++
http://en.wikipedia.org/wiki/C%2B%2B

C#
http://en.wikipedia.org/wiki/C_Sharp

In the end you can accomplish most programs/games in C# that you could in C++ in less time with a little less speed and performance gain that you would get from C++. C# also needs the .NET frame work to run which means it wont run on all OS, however this is being changed as people make .NET work for other OS's such as Linux. If you use XNA (Used for making games in C#) you will be stuck with Windows for now until a port is made they will also need .NET and XNA framework downloads for people to run your game. With C++ they just need to click your exe and it will run just fine unless they're using Direct X which most people have anyways.

Share this post


Link to post
Share on other sites
Quote:
Original post by TheMirror
Hello everyone,

I was wondering if anyone could tell me the difference between C++ and C#, and if you could kind of go over what C# is mainly used for? Thanks a lot, I appreciate your time and answers.

Sincerely,
Ross


There are like 5 billion topics for this. The search will yield more info. I have used both significantly. The short list:

- They have different, but similar syntaxes.
- C++ has been around for much longer which means it has far more support and documentation. C# though has learned from many of the lessons of the past since it's newer.
- C#'s compilation model is by far nicer.
- C# has a different way to deal with memory which places less burden on the programmer under most circumstances.
- C# has a far larger standard library.
- C# is by far more consistent, forgiving syntactically.


In the entire use of C#, it's probably most used for making ASP pages I'd guess. In the game industry it is mostly used for making utilities since it's exceptionally better at knocking up a windows UI than C++ (and because its novelty prevents widespread adoption).

If you need to ask, use C#.

Share this post


Link to post
Share on other sites
Quote:
Original post by Jettoz
These threads usually attract the fanboy squad and start a good old language flame war. I use both C++ and C# however I'm not advanced yet in these languages.

C++ is a lot harder than C# because you need to do a lot of things yourself, it's a low level language.

C# is easier for new programmers because it's a high level language and has some things done for you such as the garbage collector for un-used objects to free memory.

http://en.wikipedia.org/wiki/Low-level_programming_language
http://en.wikipedia.org/wiki/High-level_programming_language

Low level languages are harder than High level because you need to do a lot of things yourself.


If you're asking what you should learn first, I suggest C# only because C++ needs a lot more time to learn and might be harder to most people making it discouraging to learn programming.

Some more links:

C++
http://en.wikipedia.org/wiki/C%2B%2B

C#
http://en.wikipedia.org/wiki/C_Sharp

In the end you can accomplish most programs/games in C# that you could in C++ in less time with a little less speed and performance gain that you would get from C++. C# also needs the .NET frame work to run which means it wont run on all OS, however this is being changed as people make .NET work for other OS's such as Linux. If you use XNA (Used for making games in C#) you will be stuck with Windows for now until a port is made they will also need .NET and XNA framework downloads for people to run your game. With C++ they just need to click your exe and it will run just fine unless they're using Direct X which most people have anyways.

For the most part, I have to agree.
However, C++ gives you a much firmer footing in programming. It'll be harder at first, admittedly, but you will learn much more. It does divert from the core programming, and allow you to focus more on your logic and whatnot.

C++ has a ridiculously huge user base. There are literally hundreds (probably) of libraries out there, written specifically for C++.

I'm going to stop attempting to sell you C++ now, but I'd recommend you check out this, because it seems pretty impartial and just-the-facts.

Also, I didn't actually answer your question. C# is used for, in my experience, business-type applications. It's important to note that C# has to be run under the Microsoft Windows Common Language Runtime (CLR), so you will have to be on a relatively up-to-date computer. C++, on the other hand, is used for an extremely diverse range of programs.

C++ is an "open source" (I don't mean it literally; It's very portable, and non-proprietary) language, with multiple compilers out there. C# is developed by Microsoft to bring C++ developers into the .NET Framework.

C# = .NET C++, in effect. It takes out a lot of the low level stuff, too.

I hope I was of some help.

-Kommander

Share this post


Link to post
Share on other sites
One little comment on this:

Quote:
C++ is an "open source" (I don't mean it literally; It's very portable, and non-proprietary) language, with multiple compilers out there. C# is developed by Microsoft to bring C++ developers into the .NET Framework.


C# actually also is an open language by your definition. Initiatives like Mono have succesfully ported C# (i.e. the CLR and compiler) to other platforms and are working on providing an extensive library comparable to the one MS offers. There's even an initiative to create a port of XNA based on Mono.

...As this question pops up entirely too often, maybe someone feels like writing an article on C# vs C++ for GameDev, much like was done for DX vs OpenGL?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this