Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


learn 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
44 replies to this topic

#1 trapeze   Members   -  Reputation: 122

Like
0Likes
Like

Posted 14 September 2007 - 07:54 PM

i am thinking about learning even though i know very little of them. but, i don't know which is better ? by being better it may depend on my purposes. however, i would like to hear from others. thx.

Sponsor:

#2 Promit   Moderators   -  Reputation: 7341

Like
0Likes
Like

Posted 14 September 2007 - 07:56 PM

Most likely neither. What languages do you already know?

#3 jbadams   Senior Staff   -  Reputation: 19057

Like
0Likes
Like

Posted 14 September 2007 - 07:59 PM

Probably neither of those. No one can give you a sensible response to that unless you tell us what your goals are however.

#4 trapeze   Members   -  Reputation: 122

Like
0Likes
Like

Posted 14 September 2007 - 08:55 PM

Quote:
Original post by Promit
Most likely neither. What languages do you already know?



hm... matlab.. please don't laugh out loud...

i do know a bit C/C++.

#5 trapeze   Members   -  Reputation: 122

Like
0Likes
Like

Posted 14 September 2007 - 08:57 PM

Quote:
Original post by Kazgoroth
Probably neither of those. No one can give you a sensible response to that unless you tell us what your goals are however.


something i will need to work in the industry. more specifically, computer networks, communications, telecommunications and whatnot.

#6 rollo   Members   -  Reputation: 366

Like
0Likes
Like

Posted 14 September 2007 - 09:15 PM

You will need many different languages to work in the industry. I'd pick one of C#, Java, C++. Probably in that order... but you will have to keep learning new languages as you go (this is not as big a deal as you think, once you know a couple its not much harder than learning a new API)

#7 Mercenarey   Banned   -  Reputation: 103

Like
0Likes
Like

Posted 15 September 2007 - 12:45 AM

Go with C++. If you learn C++, you will automatically learn C as well.

Furthermore, it is very important that you choose an object oriented language, as that is what is used in the industry. Once you know one of the OO languages, it is fairly easy to learn the others.

C++ is the most difficult ones of the three (C++, C#, Java), and when you master C++, you will find it very easy to learn C# and Java. The opposite will not necessarily be the case.
C++ is still the most used language in the industry (actually it is almost exclusively used in the industry), so IMO it will be the most valuable for you of the three, if you wish to work professionally with it.

If your choice stands between C and C++, there is no doubt that you have to choose C++. It becomes a bit more fuzzy if you can choose among all three OO-languages.

#8 rip-off   Moderators   -  Reputation: 8526

Like
0Likes
Like

Posted 15 September 2007 - 01:26 AM

Quote:
Original post by Mercenarey
Go with C++. If you learn C++, you will automatically learn C as well.


Not true. The languages are completely different. If you "know C" by "learning C++", you either haven't learned C++ at all or you will get a nasty surprise trying to write non-trivial C programs.


Quote:

C++ is the most difficult ones of the three (C++, C#, Java), and when you master C++, you will find it very easy to learn C# and Java. The opposite will not necessarily be the case.


"When you master C++". This could take a very long time. It is arguable that onemight spend less time learning C# first then moving to C++.

Quote:

C++ is still the most used language in the industry (actually it is almost exclusively used in the industry), so IMO it will be the most valuable for you of the three, if you wish to work professionally with it.


This is true.

Quote:

If your choice stands between C and C++, there is no doubt that you have to choose C++. It becomes a bit more fuzzy if you can choose among all three OO-languages.


Just to note: there are many, many more object oriented languages than the 3 you have mentioned.

#9 Mercenarey   Banned   -  Reputation: 103

Like
0Likes
Like

Posted 15 September 2007 - 02:05 AM

Which other than those three do you want to use for game development?

Sure, it may be possible, but Im not writing a thesis on OO-languages here, Im giving advice on game development.

As for C and C++: I agree, there are alot of tricks that you would use in C, that a good C++ developer would never use (although he could). When reading C code, I have been very surprised at seeing stuff I had never seen before, or thought was at all possible.

However, when that is said, I believe that learning C++ would give you a sufficient level in C to build on. You won't know every trick in the book, but you will have a very solid foundation. The rest you can look up as you go IMO.

#10 rip-off   Moderators   -  Reputation: 8526

Like
0Likes
Like

Posted 15 September 2007 - 02:24 AM

Quote:
Original post by Mercenarey
Which other than those three do you want to use for game development?

Sure, it may be possible, but Im not writing a thesis on OO-languages here, Im giving advice on game development.

As for C and C++: I agree, there are alot of tricks that you would use in C, that a good C++ developer would never use (although he could). When reading C code, I have been very surprised at seeing stuff I had never seen before, or thought was at all possible.

However, when that is said, I believe that learning C++ would give you a sufficient level in C to build on. You won't know every trick in the book, but you will have a very solid foundation. The rest you can look up as you go IMO.


I do realise this, most of what you say has a lot of truth. But not for beginners. In fact if this wasn't the "For Beginners" forum I probably would not have replied like that.

I believe beginners do themselves an injustice by trying to learn C and C++ first. Python is an OO language that can be used for game development. You might not be writing Doom 17 and Quake 42 in it any time soon, but for a starting language it is more than adequate. The types of games people write while learning game programming tend to be retro 2D game clones, not AAA blockbusters.

There are enough pitfalls in starting programming and game programming already without adding "undefined behaviour" to the mix.

#11 NerdInHisShoe   Members   -  Reputation: 130

Like
0Likes
Like

Posted 15 September 2007 - 02:54 AM

From what I've seen so far in my software engineering course, learn C before learning C++ if you want to know both. Most students in my course knew C++ before they came in, and they're really struggling with C :-/

#12 jbadams   Senior Staff   -  Reputation: 19057

Like
0Likes
Like

Posted 15 September 2007 - 03:38 AM

Quote:
Original post by Mercenarey
Go with C++. If you learn C++, you will automatically learn C as well.
This statement is only true given that you're willing to accept being really bad at one or both of the languages. They're different languages with different idioms, and simply removing classes/namespaces/etc from C++ code does not by a long shot make for good C code.

Quote:
Which other than those three do you want to use for game development?
How about Python, as used extensively in Civilization IV and even more so in EVE Online and ToonTown Online? Although not typically used as such in industry Python can be used as the sole language to program a high-quality game rather than as an embedded scripting language and is generally much more approachable for a beginner than either C or C++. It's also used extensively in programming fields other than games.

Quote:
Original post by trapeze
something i will need to work in the industry. more specifically, computer networks, communications, telecommunications and whatnot.
Noting that you specifically outlined several non-videogame industries there, Java is very widely used and may be worth your consideration.

As some of the other posters have touched on however, it's not neccesarily in a beginner's best interest to choose a programming language based on the choices currently made by professional developers; if you're just starting out you're likely to take quite a while learning before you can consider yourself a good programmer, and so it can be beneficial to ease the task of learning by picking a more beginner-friendly language to start with and then learn any languages -- you'll find that excepting extremely different languages using different paradigms it's significantly easier to pick up additional languages after your first -- required by your chosen industry at a later stage.

#13 Captain_Thunder   Crossbones+   -  Reputation: 172

Like
0Likes
Like

Posted 15 September 2007 - 05:41 AM

Quote:
Original post by Mercenarey
Which other than those three do you want to use for game development?


Smalltalk.

#14 NoobProger   Members   -  Reputation: 229

Like
0Likes
Like

Posted 15 September 2007 - 06:17 AM

I'm learning C++ as my first language, and I'm starting to understand it - everyone says start with C# first because simple things that you won't have to worry about (like memory management if I'm correct, I'm still a noob myself)

I was going to learn VB 6.0 as my first language... (LOL) but then someone made a real good point... "You're going to get used to the simplicity of that language and when you attempt to apply what you've learned to C++ it will just put you off to it, C++ requires that you to do more... plus VB 6.0 is pretty old dummy." Don't move away from one language to another because one is 'faster' to learn, you just have to stick at either one you choose to learn first...

3 tips from mistakes I've made while trying to learn C++ (if you pick to learn it)
1) Read books, and reread parts of the book you've think you've forgotten, or are unclear on (DONT GET STUCK IN ONE PART, Move on and come back but don't sit in one part, you won't get or understand everything you read the first time you read it...)
2) Read small books. No need to jump into C++ books that are 1000 pages long and have a very large section in detail on classes, functions - you only want to learn the basics then learn more details of the basics later.
3) MAKE YOUR OWN PROGRAMS. It was until I've covered afew books that I realized I could read code and understand it, but when I tried to apply my own I'd fall on my face... same thing as learning to drive a car - you can be told which pedal is the brake, and the gas - but you've got to drive it yourself to learn how to get it to operate smoothly.

The learning curve of C++ is a monster. Grab afew cigars, get a nice book, bring the laptop outside, and read away while we still have good weather.

Or just ignore this post in its entirety... I'm still a noob here myself.

#15 JohnBolton   Members   -  Reputation: 1372

Like
0Likes
Like

Posted 15 September 2007 - 06:23 AM

The answer for beginners is neither. Go with Python. It is both simple and practical. There is no good reason for starting out with C or C++, or perhaps any of the C variants.


John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

#16 JWalsh   Moderators   -  Reputation: 463

Like
0Likes
Like

Posted 15 September 2007 - 07:53 AM

Quote:
Original post by JohnBolton
The answer for beginners is neither. Go with Python. It is both simple and practical. There is no good reason for starting out with C or C++, or perhaps any of the C variants.


I'm not sure I entirely agree with John's statement. Specifically, the last part "...or perhaps any of the C Variants."

In general, C is less commonly used in game development these days due to C++'s superior support for Object Oriented Programming. However, C++ can be a difficult language to begin with.

In contrast, C# is much simpler, has less ambiguity built into the language, has tons of support forums, etc...and even has XNA - an API for beginning and hobbyist game programmers. So while C is largely abandoned for modern game programming, and C++ is overly complex, C# is both powerful, easy to use, and well supported.

If you're set on learning a C-style language, I highly recommend C#.

Now, with all that said, there's nothing wrong with trying Python first. It'll help you get down the basic semantics of modern programming, while giving a fairly gentle introduction to the syntax. From Python, it should just be a matter of learning the keywords and syntax differences to move to C#, and from there, it's a hop, skip, and a jump to C++.

As to a good reason to start with C++, well it is the industry standard for game development. So by learning it first, you jump straight into the Lion's Den. But, it more often than not results in "baptism by fire." So I'd not recommend it, in spite of the fact that learning C++ first has perfectly valid reasons.

Anyways...I'm rambling now. My vote, start with C#. If you're intimidated by C#, start with Python. And in the end, learn them all.

Cheers!
Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints

#17 Sneftel   Senior Moderators   -  Reputation: 1781

Like
0Likes
Like

Posted 15 September 2007 - 08:54 AM

Quote:
Original post by NerdInHisShoe
Most students in my course knew C++ before they came in, and they're really struggling with C :-/
Most students who "know" C++ don't really.

#18 Mercenarey   Banned   -  Reputation: 103

Like
0Likes
Like

Posted 15 September 2007 - 10:27 AM

Kazgoroth:
So you are seriously gonna recommend C over C++ for game development?
Because that is what this thread comes down to, isn't it?

Java? Does that even communicate with DirectX or OpenGL (the only two serious interfaces to modern GFX-cards)?
C# looks like it is gonna out-compete it anyway (I am not particularly fond of MS myself, but that is how it looks anyway).

Python? Are you serious? Are we not discussing programming languages? Python is a scripting language AFAIK.

CaptainThunder:
Smalltalk for game development? You must be kidding...

#19 rip-off   Moderators   -  Reputation: 8526

Like
0Likes
Like

Posted 15 September 2007 - 10:32 AM

Quote:
Original post by Mercenarey
Kazgoroth:
So you are seriously gonna recommend C over C++ for game development?


Of course not. Read his earlier posts, he recommended python.

Quote:
Because that is what this thread comes down to, isn't it?


They often do, but they shouldn't.

Quote:

Java? Does that even communicate with DirectX or OpenGL?


Yes. It can talk to anything C can using the Java native interface...

Quote:

C# looks like it is gonna out-compete it anyway (I am not particularly fond of MS myself, but that is how it looks anyway).


C# is an open standard, Microsoft happens to have the most complete implementation so far.

Quote:

Python? Are you serious? Are we not discussing programming languages? Python is a scripting language AFAIK.


You know wrong. Python is just another programming language.

Quote:

CaptainThunder:
Smalltalk for game development? You must be kidding...


I imagine he is, but I've been surprised at odder things before [smile]

#20 Captain_Thunder   Crossbones+   -  Reputation: 172

Like
0Likes
Like

Posted 15 September 2007 - 10:37 AM

Quote:
Original post by Mercenarey
Java? Does that even communicate with DirectX or OpenGL (the only two serious interfaces to modern GFX-cards)?


Not sure about DirectX, but it has OpenGL.

Quote:
Original post by Mercenarey
Python? Are you serious? Are we not discussing programming languages? Python is a scripting language AFAIK.


The distinction between "programming languages" and "scripting languages" is pretty meaningless. Python can do anything that other languages can do, and in some cases, it does things better.

Quote:
Original post by Mercenarey
CaptainThunder:
Smalltalk for game development? You must be kidding...


Smalltalk is an obscenely powerful language. It probably wouldn't be my first choice for a game, but it's well worth learning for other reasons.

EDIT: Beaten to it [smile]




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