Learn c# or C++?

Associate
Joined
28 Jun 2005
Posts
2,174
Location
Behind you
Hi,

I've been programming in various languages like Blitz, Purebasic and Darkbasic and thought its about time I learnt a "grown up" language. The aim is to start simple, then make simple games that hopefully will get better as I do. Seeing the Express c# and c++ editions are free I dunno which one I should go for. Also, any good books or sites for beginners?

Ta
 
You'll most likely find it easiest to move to C#, at least initially. There are plenty of online resources, including msdn, codeproject, etc., etc.

Although C# is quite like C++ in syntax, certainly more so than BASIC, it doesn't require the user to learn memory-management, and doesn't have the overhead of learning the C style heritage of C++. In this regard C# owes more to java than C++, learning C# and then learning java may be a more desirable route.

You could also simply move to java, the Eclipse development platform is free to download, and there's a wealth of java resources available online.

Not to sure on what books to recommend. Best to decide which route you want to take and then ask what books might be best. You might also find a good deal more information on some dedicated development forums, depending on which language you choose.
 
Ta mate, thanks for the input. Is C# as fast as C++ at looping, maths ect?

I'll give you a quote from the Microsoft MVP that lectures on my computer science course.

"C++ is a formula 1 racing car. It goes extremely fast but if anything goes wrong, it goes very very wrong. C#, on the other hand, is like a family car. Safe, reliable, gets you from A to B but may not be the quickest way to get there."

As I understand it, C# is a lot safer when you're writing code and it won't let you do stupid things. C++ will let you do daft things such as going over the end of an array stack and into some memory allocated to something else (Not good).

I learnt C# in my first year (Now in my second) and it is a very nice language to learn. I've been programming PHP for 5-6 years so it was extremely similar. C++ is similar to C# but it only does exactly what you tell it and in that respect, would be more irritating to learn :)

EDIT: That's the reason games are still written in C++ and not C#. It's much faster. However, I would think that some software packages that require the extra security given by C# will be using that language as the speed doesn't matter.
 
Hmmmm ta. I take it that on modern PCs, you wont notice the speed difference unless you're coding sommit like a game engine like Unreal or Crytek.
 
"C++ is a formula 1 racing car. It goes extremely fast but if anything goes wrong, it goes very very wrong. C#, on the other hand, is like a family car. Safe, reliable, gets you from A to B but may not be the quickest way to get there."

I knew i remembered those words! Mr. Miles i believe? :p

Learning C++ will put you in a better standing in the long run IMO, you will learn a lot more from it. Yet in comparison C# is very easy to pick up and quick to get stuff done in.
 
Last edited:
You might want to have a look at XNA Game Studio Express if you want to get into game programming with C#. I've no idea what it's like as I've never tried it, but it's worth a look :)
 
You might want to have a look at XNA Game Studio Express if you want to get into game programming with C#. I've no idea what it's like as I've never tried it, but it's worth a look :)

I am a long time C++ and bare DirectX SDK (C\C++\COM) user, but if I was just starting out I would definately go for C# and XNA. XNA uses DirectX at a lower level anyway.

I would recommend starting with c#\XNA and maybe switch to C++\DirectX later.
 
I've been using C++ using the DirectX SDK and can highly recommend that. I've also studied Java at Uni and also currently using C# at work for software development. Looking at the languages that you have previously used i would personally go with the C++ route which should be easier to get in to.
 
C#? I thought you wanted to learn a grown up language :D

Honestly though, C++ for rich client applications (especially open source rich client), c# for .NET specific web applications.
 
Definitely. Visual Studio is ace.

And I'd say C# because it's a better designed language and more pleasant to work in.
 
How does C# compare to other languages in terms of speed? On the purebasic webite, it says it matches the speed of most C++ compilers, so would that mean its faster than C#

Thanks
 
C# will be slower than C++. But is comparative speed really a big concern for you?

Take a lot at some XNA stuff done in C# and decide whether the platform's speed looks like it would hold you back.
 
Last edited:
I think the 2008 version will be released by the end of the month, so might be worth getting some time in with standard C# first then going for that :)
 
learn c#. programmer time is much more expensive than CPU time, and you'll be a lot more productive with c#. I have several years experience with c++, and am only learning c#, but already feel I'm more productive with c#. if you need something to run fast, you can always optimise a component later in c++ (there are good options for interoperability between the two languages). usually it's only a very small part of the code that you have to really optimise.
 
Back
Top Bottom