Jump to content

  • Log In with Google      Sign In   
  • Create Account


C, C# or C++?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
27 replies to this topic

#1 HuwFulcher   Members   -  Reputation: 124

Like
0Likes
Like

Posted 10 April 2011 - 08:04 AM

Okay I want to learn a few game programming languages to get a head start in Uni but I'm not sure which of the three in the topic is best to start out with. Once I have a good knowledge of one or two of the above languages I will move onto Python and Java to cover all the bases :P

Sponsor:

#2 Hodgman   Moderators   -  Reputation: 27814

Like
0Likes
Like

Posted 10 April 2011 - 08:07 AM

Why not start with Python, then C#, then C++? :P

#3 HuwFulcher   Members   -  Reputation: 124

Like
0Likes
Like

Posted 10 April 2011 - 08:10 AM

Does Python have similar syntax? I've made a little application with C# before so it should be easier to get to grips with :)

#4 GesterX   Members   -  Reputation: 104

Like
0Likes
Like

Posted 10 April 2011 - 09:04 AM

Start with C# and make some simple programs (stuff that reads in a text file, a calculator, an organiser etc).

Then add in the XNA framework. There's some really clear setup and installation instructions on the XNA website on how to get started. There are also a few good tutorials to get you started making some simple games. It's free to make games for Windows and if you find yourself getting interested you can purchase a creators club membership for about £80 which allows you to publish for Xbox 360.

That should easily keep you busy for the next few months.

I would only move on to C++ once you are competent with object oriented principles (Classes, Abstraction, Encapsulation, etc) and data structures (stacks, queues, lists, etc).

Does Python have similar syntax? I've made a little application with C# before so it should be easier to get to grips with :)


Once you are adept at C#, python will seem incredibly easy to get to grips with. The only reason I would advise learning C# first is that it prepares you for learning C++ which will help you get into the games industry (which based on your previous threads; I am assuming is your goal)
Game Designer at Playground Games

#5 starvinmarvin   Members   -  Reputation: 129

Like
1Likes
Like

Posted 10 April 2011 - 11:58 AM

I may be a bit stuffy regarding that topic (or like reinventing the wheel) but I suggest using C++ if you really want to learn something. If you just want to "make game" use C# and XNA.
I don't want to start a C# discussion, but I know a lot (often younger) people who use C#, .net + Frameworks and consider themselves to be superior but in fact don't even know basic stuff. For example using linked lists etc. without knowing what it is. My two cents.:P
If your only goal is to be prepared for Uni use Java.

#6 mhagain   Crossbones+   -  Reputation: 7452

Like
0Likes
Like

Posted 10 April 2011 - 12:26 PM

In general, many concepts you learn with any programming language are going to be applicable to any other language. The kind of things I'm thinking about here include data types, flow control, data structures, etc. At your stage I think these are going to be of most immediate benefit to you, and will give you a decent head-start on your course. So pick the language that you feel most comfortable with right now, and exercise yourself a little on that. Try to push the boundaries of your knowledge.

If you want to get into games - aside from perhaps game logic scripting - you absolutely must have more knowledge of what goes on "under the covers" than languages like C#, Python or Java provide. You need to know a lot of ugly details about pointers, memory architectures, algorithmic efficiency, and so on. I'd say don't bother with these for now; they'll only confuse you, or at worst put you off. But do bear them in mind as an avenue that you're going to have to explore at some time.

The same applies to C++/STL - it contains a lot of nice containers for handling common data structures, but unless you know what's going on behind the scenes with them you'll only end up using them inefficiently or inappropriately, and writing O(n2) algorithms everywhere. You need - IMO - to know how to write, for example, a linked list yourself before you start using a pre-canned container. That way you know the correct access patterns to use for it, you know the incorrect access patterns, and - more importantly - you know why they're correct and incorrect.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#7 j-locke   Members   -  Reputation: 811

Like
0Likes
Like

Posted 10 April 2011 - 12:35 PM

If you're getting started in Uni soon so you know where you'll actually be going, I'd say take a look at their computer science department's web page or find some of their recent syllabi or talk to someone currently attending to find out what languages they're teaching right now. And go ahead and get the ball rolling in the same language.




If you don't know where you'll be going (like if things aren't lined up yet as it's too far in the future), then out of the 3 you offered as choices, I'd say C#. It's simpler to pick up than C or C++. And knowing it will ease a later transition into learning C++.



#8 TheTroll   Members   -  Reputation: 882

Like
0Likes
Like

Posted 10 April 2011 - 01:10 PM

I may be a bit stuffy regarding that topic (or like reinventing the wheel) but I suggest using C++ if you really want to learn something. If you just want to "make game" use C# and XNA.
I don't want to start a C# discussion, but I know a lot (often younger) people who use C#, .net + Frameworks and consider themselves to be superior but in fact don't even know basic stuff. For example using linked lists etc. without knowing what it is. My two cents.:P
If your only goal is to be prepared for Uni use Java.


Sorry but I think you might be missing the goal of software development. The goal is always to produce something. Languages are just tools. Do you have to know how to make or use a linked list to be a good developer? Not at all. Use the best tool to get the job done. If you are making a device driver, I would say, use c/c++. If you are making a basic windows app or indie game C# does the job just fine.

This whole "this language is the best" idea is just utter garbage.

#9 Nanoha   Members   -  Reputation: 296

Like
0Likes
Like

Posted 10 April 2011 - 01:41 PM

c#, its a nice middle ground, particulaly with xna. I'f your going to be learning java at uni though, then you might as well just go straight for it.

#10 MeshGearFox   Members   -  Reputation: 158

Like
0Likes
Like

Posted 10 April 2011 - 06:19 PM

Common Lisp or maybe even Scheme. Primarily because they have a lot of good material for people new to programming in general. C and C++ don't, really. Also C# is more Java than C or C++. Maybe C# has good introductory material. I don't know. I thought the O'Reilly XNA book was pretty worthless.

The other advantage with starting with CL or Scheme is that a lot of the really interesting idea from those transfer really easily to something like Lua, and apparently Python and Ruby as well though I don't really know those.

The problem with starting in C++, I think, isn't so much that C++ is hard, but that a lot of the pedagogy and theory about it is either bad or flat-out wrong. I don't know much about C beginner materials. It might be better.



#11 GothSeiDank   Members   -  Reputation: 156

Like
1Likes
Like

Posted 10 April 2011 - 06:23 PM

To be honest, I would start with C++ then C# and would leave C alone first.
Why?
Many C# or Java Programmers going over to C++ have a bad habit in using new for everything, but never delete. I see this on various forums all day.
C Programmers going over to C++ have the bad habbit in writing C with Classes and ignoring C++ Features like Vectors, Strings etc and pack everything and their mother into Arrays and void-pointers, giving up typesafety of C++.

Thats very zynical, I know. But is the daily truth to some degree. May not fit upon you, but fits on many other people :D.
You can see "C with Classes" a lot when students from University are posting Threads with the tasks from their professors. :lol::cool:
If you say "pls", because it is shorter than "please", I will say "no", because it is shorter than "yes"
http://nightlight2d.de/

#12 MeshGearFox   Members   -  Reputation: 158

Like
0Likes
Like

Posted 11 April 2011 - 01:15 AM

C with Classes


I think C++ is better regarded as C with self-referential structs and Haskell-esque metaprogramming.



#13 ryan mccabe   Members   -  Reputation: 161

Like
0Likes
Like

Posted 11 April 2011 - 01:28 AM

Ive just completed the two 100 level computer science courses at my uni that are required to move on to 200 level. There are two variations, two with java and two with c++. I did the C++ version, and really its just c (someone called it better c). posting questions on the cplusplus site the response was "why arent you using x feature of c++. Anyway what I got from the conversation that followed was that, first I wasnt using c++ second, that its standard for students to start with c in order to learn the basics and how things work before having the language do it for you, ie arrays vs vectors (roll your own lists before using the built in ones) or cstrings over strings (roll your own character handling before using the languages). My recommendation after coming out of the first year courses would then definitely learn c, as well as classes and structures.

I wouldnt recommended java first because the profs have told me that c++ is gaming standard and AFAIK this is correct. Also the higher courses are primarily c++, java is offered for those taking intro comp sci as a requisite for another program.

Just my two cents. But Im really a phil major so who knows lol.

Edit: check out http://www.cplusplus.com/reference/. This site has literally been my textbook. Id start with the c library and work down. The most important parts for me were cmath, cstring, cstdio, and maybe ctime for random number generation. The projects we did were all console based, and the final projects were a connect 4 in the console and icebreaker in the console. Small projects revolved around getting to know the language. Hope it helps.

#14 Hodgman   Moderators   -  Reputation: 27814

Like
0Likes
Like

Posted 11 April 2011 - 01:32 AM

I think C++ is better regarded as C with self-referential structs and Haskell-esque metaprogramming.

You took that quote completely out of it's context there to the point of it being meaningless to quote it....He wasn't regarding C++ as "C with classes" in the slightest.

#15 TSlappy   Members   -  Reputation: 121

Like
-1Likes
Like

Posted 11 April 2011 - 02:00 AM

It is better to learn one language and master it than to learn 10 languages and google everything more advanced :)
I suggest C++ - it is not so difficult and it is usable on every platform...
When you master C++ every other language will be easy for you.

C# without .NET framework can do nothing, also Python and Java need a lot of stuff around them.
If you start with Java/C# you receive bad habitats and later you shall have problems with memory allocs etc.

I hope you do NOT think about such languages as C/Pascal -> those are nor for professionals!

#16 Rich Brighton   Members   -  Reputation: 100

Like
0Likes
Like

Posted 11 April 2011 - 02:35 AM

I hope you do NOT think about such languages as C/Pascal -> those are nor for professionals!

Doesn't Linus Torvald's use C? I understand he not only likes to not use C++, but also likes to not use C++ programmers.;)

#17 rip-off   Moderators   -  Reputation: 7679

Like
2Likes
Like

Posted 11 April 2011 - 03:17 AM

It is better to learn one language and master it than to learn 10 languages and google everything more advanced

While you should certainly master at least one language, you should also learn many languages. These will teach you to think outside the box your language of choice puts you in.

When you master C++ every other language will be easy for you.

Definitely not true. It won't help in the slightest for languages with vastly different paradigms like Prolog, Haskell or Erlang.

C# without .NET framework can do nothing, also Python and Java need a lot of stuff around them.

Irrelevant. C without the runtime is pretty limited. You couldn't allocate dynamic memory, manipulate files or read/write from standard input. Even with the C runtime, you are pretty limited in that there is no standard support for threading, graphics, sound and many other parts of a computer.

If you start with Java/C# you receive bad habitats and later you shall have problems with memory allocs etc.

Bullshit. If you start with any language you can learn habits that could be considered "bad" in the context of a different language, i.e. that they won't translate directly into said language. It doesn't make the habits themselves poor. It is like saying that learning idioms in spoken language is poor practise because you won't be able to use them in other languages.

I hope you do NOT think about such languages as C/Pascal -> those are nor for professionals!

You'd be surprised. C is still a viable tool for the modern professional. Pascal is rarer, but legacy support has a long tail.

#18 Domx   Members   -  Reputation: 159

Like
1Likes
Like

Posted 11 April 2011 - 05:32 AM

From my experience with university and self taught programming, I'd strongly recommend that you start by learning C. I mean pure C, not C++. This way you start with a simpler, structural language and without the overhead of oop you can focus on learning how to use a language properly in its simplest form and also how to be reasonably efficient and save in regards to memory handling. As a lower level langauge than C# or Java or even C++ (in some ways) C also forces you to learn more about how compilers work and what they actually do to the code you write and how to make the most of their capabilities. I wouldn't recommend using C for anything practical, apart from some training, instead - think of it as if it was Latin - a dead language (not true in case of C, but just bear with me :)), but also the foundation of most of European languages. You can't really chat up foreigners with it, but it will make it easier for you to learn any modern, European language. In case of C - modern oop languages, of course.

Once you get there, jump over to C# or Java. I'd recommend C# for a variety of reasons, but it is my personal choice - some people prefer the latter. C# is definately a good language for learning oop, easy to get into and manipulate, enjoyable and most of all it is ready for production - grab XNA (or SlimDX or whatever) and you can start writing games. If that fulfills all your needs, I'd stick with i - If it ain't broke, don't fix it. If that's not the case (you want more efficiency, use only C++ compatible engines etc.) only then progress to C++.

However, as proven by a number of replies, there are different schools of thought on the subject. You will probably end up finding your own way, just remember not to be sceptical about anything - some people will tell you that C# and Java or Z [input another modern programming language of choice here] are rubbish, for X and Y reasons. In the same manner, C programmers used to bash C++ and C was loathed in its time, as well. Just give whatever interests you a go and don't get disencouraged, because of other people's opinions - sure, they might turn out to be right, but they may also turn out to be simply ignorant, arrogant or both.

#19 mhagain   Crossbones+   -  Reputation: 7452

Like
1Likes
Like

Posted 11 April 2011 - 05:39 AM

Pascal also has a relatively modern OO implementation in Delphi which was quite widely used not too long ago, and likely still is in certain quarters. Expressing language elitism and snobbery establishes nothing other than that you're a language elitist and a snob.

Learn concepts, not languages. So long as the paradigm isn't too wildly different, knowledge of the concepts will enable you to pick up and meaningfully use any new language in a very short time indeed.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#20 Gamer Gamester   Members   -  Reputation: 136

Like
1Likes
Like

Posted 11 April 2011 - 11:31 AM

If I were starting over I would begin with Python. It's a beautiful language, and you'll certainly get results much quicker than with something like C or C++ (can't speak for C# -- haven't used it yet). As a beginner, I stubbornly refused to learn anything other than C++, thinking that doing so would be sacrificing power & control. But being able to finish a project in a reasonable timeframe turns out to be amazingly powerful, and C/C++ are not best suited for that.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS