Jump to content
  • Advertisement
Sign in to follow this  
velentry

C++ or C#

This topic is 3807 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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++.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!