C++ or C#

Started by
113 comments, last by zedz 15 years, 9 months ago
Hi its me Vel, I am looking to make a simple RPG with transitions between battle and the usual so i can learn a programming language the only problem is before i spend some money buying books (the best way i learn :P) i was hoping someone could recommend a programming language that would be best. The main area i would like to concentrate on would be RPG's which is probably just about the same as everyone else but i am also quite tempted with the idea of a Platform game so i would need a language that would be versatile for both.....or wouldn't it matter. Sorry if the above seems a thick question :P Vel
Advertisement
I've used both languages for years now (well, a whole lot more of C++ than C#), and my opinion is that C++ is better in every way. C# is just too much of a mess, since it's .NET (Yes, I think .NET is a mess) and not well supported by graphics libraries.

So in my opinion, you should buy some good C++ books (I can't recommend titles because I have none).

Michel
C++ or Java. Java has some 3D/2D libs with it, where C++ doesn't. C++ you can code OpenGL or DX. Java works with OpenGL also.

Depends on what you want to do. If you want to run on all platforms I would use either

Java/OpenGL
or
C++/OpenGL


Book for C++
http://www.amazon.com/Ivor-Hortons-Beginning-ANSI-Complete/dp/1590592271/ref=sr_1_5?ie=UTF8&s=books&qid=1214992603&sr=8-5

Ivor Horton's Beginning ANSI C++: The Complete Language, Third Edition (Expert's Voice) (Paperback)

Quote:i was hoping someone could recommend a programming language that would be best.


There is no such thing as The Best Programming Language. Period.

Sorry if this sounds cross, but we get these threads several times a day. In fact, here are the most recent 916 predecessors. To answer your last question, the language doesn't matter one bit when considering RPG vs Platform gameplay. You can happily code either game type in whatever language you wish.

Michel recommends C++ and I'd recommend C#, which does happen to have decent support for graphics libs with initiatives such as XNA, SlimDX and Tao. It just comes down to personal preference and experience.
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
These "What language is best?" threads always have the potential to escalate into something much more (i.e. a flame war) so OP, I'd do some research on BOTH languages first for yourself.

Personally, I'm a C++ fan. I've used this language for a few years now and that obviously means that any advice I give you would be biased.

However, I hear C# does have some merits, to which I'm warming up to. Namely in creating game tools (which you'll probably need for any major projects you intend to create anyway!).

So perhaps learning BOTH could be a wise choice. I've seen C# code and a lot of its syntax is based on C++ so the transition between the two languages isn't that great (although deep down they are quite different in many aspects).

But if time is of the essence, and you only want to get down and dirty learning ONE language, then I'd choose C++.

C++ is by far the dominate language in the video games industry and there always seems to be a shortage of proficient C++ programmers. So long term you just can't go wrong if you master C++.

My 2 cents.
Thanks TerrorFLOP, for addressing some of the issues I was wondering about. I have learned C++ and been using it to code a couple of simple games for my own enjoyment and progress, but recently I've read some thing suggesting C# might not be a bad addition to make. I was wondering just how different the two languages are and how much use C# sees in commercial game development.
So again, thanks for keeping me from creating another of these threads!
It depends on how much programming experience you have and in what languages. If you're completely new to programming you'll need to be working on understanding the basics before you get to doing anything as complicated as a graphical game. You'll undoubtedly learn more languages as you go, so if you're just starting out it's best to pick a language that's suitable to learn in rather than what you think you'll be using for the rest of career.

If you're completely new to programming and open to other languages I'd recommend Python. It's a nice language to start with, and is capable of making simpler 2D games on its own.

I don't know C#, but I do know a fair bit of C++, and I can't really recommend it as a starter language. It's got a fair learning curve before you can understand how to do anything, and you need to do a lot of housekeeping within your programs that other languages will do for you. C++ is also nigh-impossible to master; once you get to the really advanced stuff it gets real convoluted. The more I learn the more complex it seems. Personally I'm now moving more towards working with Python and C instead of C++.

I'd personally vote for C#. While it is relatively easy to understand for beginners, it still has a powerful syntax (especially C# 3.0) and several facilities to use native code if necessary (DllImport, referencing mixed mode C++/CLI assemblies, tblimp).

If you don't absolutely need the platform indedepency of Java, I'd definitively prefer C# over Java. Having worked with both I can say the C#/.NET is more polished than Java. When C#/.NET came out, many people said C# would steal from Java. Now it's the other way round: look at the specs for the upcoming Java 7 and you'll find a lot of features C# already has built in (and you will miss a lot of feature if you're used to C#).

Above all, the Java virtual machine is completely based on (non-generic) classes, interfaces and the primitive types (int, float etc.) From the Java VM point of view, generics don't exist, enums don't exist etc. Those features are syntactic sugar only which depend on the support by the Java compiler.

The .NET CLR on the other hand has classes, interfaces, enums, structs, delegates and generics as first class members. This provides a lot more potential for writing efficient (less boxing etc.) code which is desirable for games.

Having said that, the basics of Java and C# are comparable, so especially at the beginning you may get happy with any of the two. What's for sure is that a managed environment like C# or Java will be a easier to deal with if you're new to programming.

Finally, understanding programming concepts that are independent of the language (think of OOP concepts etc) will be more important than the choice of the language after a while.

So: Just pick one language and play with it!

Regards,
Andre
Andre Loker | Personal blog on .NET
First off ill apologize to TERRORFLOP i had no intention of wanting to create this into some sort of flame post so sorry if it came across that way.

Anyways i can see picking a language is like an artist picking a pencil everyone has there own preferences of which to use yet they all kinda of get the same results if you know what your doing.

But by the sounds of everything I'm guessing C# or Java simply because i am very new to programming i won't hide from that fact, and i do know that when going on games on the internet that all seem to use Java or used to i haven't tried in a while XD. Also though once i do get the hang of C# or Java ill probably give C++ a try as well since then i will understand scripting much more and it will help me a lot since I'm aiming myself towards a career in game or CG film developing.

Thanks for all the help I'm going to be getting my hands dirty in some code, my programming virginity will be gone forever :P

Anyways once again thanks for all the help
Vel
Quote:Original post by velentry
Hi its me Vel,

I am looking to make a simple RPG with transitions between battle and the usual so i can learn a programming language the only problem is before i spend some money buying books (the best way i learn :P) i was hoping someone could recommend a programming language that would be best.

The main area i would like to concentrate on would be RPG's which is probably just about the same as everyone else but i am also quite tempted with the idea of a Platform game so i would need a language that would be versatile for both.....or wouldn't it matter.

Sorry if the above seems a thick question :P
Vel


I'm using C++ at work, and C# for my home project.

If C++ and C# are your only choices, and you're rather new to programming, then C#, without a doubt.
C++ has too much of a learning curve for beginners to get results quickly. For example the whole manual memory management, pointers and lack of basic functionality (like the .NET framework provides) make it a poor choice to be a language to begin with.
C# does those things for you.

The argument of libraries being mostly in C/C++ is not much of an argument either. There are plenty of libs for C# that are aimed at game development that can do things like networking, graphics and physics for you. You just have to look more around a bit.
STOP THE PLANET!! I WANT TO GET OFF!!

This topic is closed to new replies.

Advertisement