Jump to content

  • Log In with Google      Sign In   
  • Create Account


When to start with 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
37 replies to this topic

#1 stein102   Members   -  Reputation: 475

Like
3Likes
Like

Posted 09 March 2013 - 03:56 PM

Almost everyone who posts on this forum will usually argue that it's best not to start with C++? But how will you know when it's time to move on to C++?

 

The reason I want to get into C++ is not because I think it's a superior language to Java(What I use now), I just feel that there are more C++ game programmers out there and it's easier to get support on my projects and more code samples to look at.


Edited by stein102, 09 March 2013 - 03:58 PM.


Sponsor:

#2 wintertime   Members   -  Reputation: 1640

Like
4Likes
Like

Posted 09 March 2013 - 04:06 PM

If you want to know C++ then start with it now and dont waste time learning something you dont want to use.

If you want to know Java then start with it now and dont waste time thinking about maybe learning C++ later, but dont do it if you think its inferior(whether thats valid or not) as that only gets demotivating for you.

If you know one of those languages already well someday and only at that point decide to learn another that is also something good to do.



#3 stein102   Members   -  Reputation: 475

Like
1Likes
Like

Posted 09 March 2013 - 04:16 PM

Well, I already know a fair amount of Java and feel pretty confident with it. But I also know that C++ is the industry standard for Game Programming and that I'll eventually have to learn it.



#4 kd7tck   Members   -  Reputation: 715

Like
1Likes
Like

Posted 09 March 2013 - 04:25 PM

I came into programming the old fashioned way. I started with Basic then moved to C and then C++. I personally would not recommend you learn C++ until you first learn the C way of doing things.



#5 Damian.   Members   -  Reputation: 272

Like
9Likes
Like

Posted 09 March 2013 - 04:49 PM

There is not so big difference between Java syntax and C++ syntax. So if you know Java and learn some things about C++ like (Pointers, Dynamic memory), you could easily translate code from C++ to Java (I'm talking about sample codes here).

 

If you want to learn C++ just learn it, you said that you already know Java, so it won't be hard (You just need to read about - Templates, Operator Overloading, Pointers, etc.) things that aren't in Java.



#6 Karsten_   Members   -  Reputation: 1560

Like
6Likes
Like

Posted 09 March 2013 - 05:07 PM

I think it is an elitist thing personally. Some people (especially in game development communities) put C++ so high up on a pedestal that it is becoming "scary" for newcomers. This is annoying, especially for those who do find the language to be easier for what they want to achieve.

 

If you feel like you should be learning C++, then go for it. I personally wouldn't recommend anything else (Other than C if the project is not game related).


Edited by Karsten_, 09 March 2013 - 05:08 PM.

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.


#7 Anri   Members   -  Reputation: 597

Like
6Likes
Like

Posted 09 March 2013 - 05:18 PM

I would just go for it.

 

Besides becoming familar with a language that is a main player in the games scene, you will discover new ways to program.  For example, and off the top of my head, Java source files only need one file whilst C and C++ throw header files into the mix.  Also, C++ classes make you aware of destructors, which are vital as C++ does not have a built-in garbage collector...

 

So long as you accept that C++ does things differently, then you should find learning it straight forward. Don't forget you have knowledge of OOP(from your Java experience), which makes learning C++ that little bit easier.



#8 SimonForsman   Crossbones+   -  Reputation: 5991

Like
5Likes
Like

Posted 09 March 2013 - 05:27 PM

Almost everyone who posts on this forum will usually argue that it's best not to start with C++? But how will you know when it's time to move on to C++?
 
The reason I want to get into C++ is not because I think it's a superior language to Java(What I use now), I just feel that there are more C++ game programmers out there and it's easier to get support on my projects and more code samples to look at.

If you want to learn c++ then learn c++, there is no such thing as "moving on to" languages though, you just keep adding them to your toolbox. I learned C++ before i learned Java, i learned C#, Python, Lua and a whole bunch of other languages after that and i still use most of them from time to time.
I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#9 0r0d   Members   -  Reputation: 804

Like
10Likes
Like

Posted 09 March 2013 - 05:28 PM

If you want to learn C++, then learn C++.  =)  It's the standard language for professional game programming and there's tons of resources to help you learn and help you code once you learn it.  I actually started programming with C++ in college (single quarter-long course, Intro to C++) and then basically self-taught myself everything else through books and hobby programming (wrote a software 3D rendering engine).  Then after college I got a job as a game/graphics programmer... and my only formal programming education was that single course in introductory C++.  So, it's not that hard to learn, especially if you already have a background in something like Java.


Edited by 0r0d, 09 March 2013 - 05:31 PM.


#10 stein102   Members   -  Reputation: 475

Like
2Likes
Like

Posted 09 March 2013 - 05:47 PM

Okay, I think I'll dive into C++ then. What book would you recommend me to pick up? I was thinking something like "Beginning C++ through game programming" Or "Programming principals and practice using C++" What would be the best book for me? Thanks



#11 Dan Mayor   Crossbones+   -  Reputation: 1712

Like
4Likes
Like

Posted 09 March 2013 - 06:21 PM

    A little late to the party and I'm going to chime in with the unpopular opinion.  I think you should move in to C++ when all else fails.  C++ is the highest performing language when properly optimized to a systems hardware and even then only when performing complex floating point math.  Beyond that Java and C# are languages that optimize themselves to your users hardware (more times than not making them perform better than a standard portable C++ optimized program) and they are many many times more productive, that is you get more done with less work.

 

    Before everyone jumps in and "corrects" me that C++ is so much more powerful, that it's performance is so much faster or that it is the only portable language out there let me do a bit of debunking.

 

http://stackoverflow.com/questions/138361/how-much-faster-is-c-than-c

http://stackoverflow.com/questions/2285864/why-is-net-faster-than-c-in-this-case

http://www.codeproject.com/Articles/212856/Head-to-head-benchmark-Csharp-vs-NET

 

... and a simple search of "C# Faster than C++" will yield quite a bit more like articles that show less biased testing and benchmarking.  I would assume the same can be shown for java.

 

    So before I get too far off topic here the point is that Bytecode languages such as Java and C# are regularly and falsely accused of hindering performance of your code upwards of 25% when in actuality this is less fact than it is truth.  The arguments always come from highly biased C++ advocates that create their benchmark testing in such a way that it forces the opposing language to slow down and perform outdated practices.  Couple this with the fact that C++ is a much more difficult language, not entirely OOP (it's a linear language with OOP capabilities), the fact that all compilers and builds can be different, and a slew of other productivity hindrances that C++ imposes, my first recommendation is always to learn a language you are comfortable with and learn it well while ignoring everyone telling you that C++ is the only answer.  So the point of this, you mention that you already know some Java?  GREAT  learn the rest of it and make a game!


Digivance Game Studios Founder:

Dan Mayor - Dan@Digivance.com
 www.Digivance.com


#12 Alpha_ProgDes   Crossbones+   -  Reputation: 4688

Like
5Likes
Like

Posted 09 March 2013 - 06:45 PM

I came into programming the old fashioned way. I started with Basic then moved to C and then C++. I personally would not recommend you learn C++ until you first learn the C way of doing things.

 

I would disagree with that. C++ has a particular way of doing things and it's best that if you are going to learn C++, then you learn idiomatic C++. Learn the C way of doing things, when you decide to learn C. For emphasis, C != C++. Not even in a "C is a subset of C++" sort of way.


Beginner in Game Development? Read here.
 
Super Mario Bros clone tutorial written in XNA 4.0 [MonoGame, ANX, and MonoXNA] by Scott Haley
 
If you have found any of the posts helpful, please show your appreciation by clicking the up arrow on those posts Posted Image
 
Spoiler

#13 Nercury   Crossbones+   -  Reputation: 766

Like
3Likes
Like

Posted 09 March 2013 - 07:04 PM

Just some anecdotes from me too:

 

I knew some languages when I started, Java/Delphi/VisualBasic. So I could do basic programming without thinking too much about it.

 

First time I started with C++ when I had to do some university assignments with it. I remember passing *** pointers to pointers between stuff and learning never to clean up memory because that got in a way of finishing my task... Loads of trouble. I also learned that you can get ridiculous stuff to compile with C :). And even work somewhat, and print endless strings of OS memory. Fun.

 

I tried to stay away from C++ since then, got into C#.

I remember making DirectSound filter with C# and realized that you can't compete with compilers like C in areas such as real-time sound processing. Just no easy way.

Later I got into XNA right when it appeared. I experimented with HDR post-processing effect in XNA and also got a bit disappointed in speed limits. You just can't beat no-check, direct memory access.

 

Later I worked on some networked application and I did it with C++. That's when I learned real C++: standard library, threading (with boost), templating, and wrote my own smart pointer template (although later I realized it already existed). The bugs I made were very tough. They really bite you in C++, especially pointer-related things.

 

So to answer your question. When will you know to move to C++? I know that if i had moved to it sooner, I would had learned it sooner. It is simple as that :).



#14 unit187   Members   -  Reputation: 274

Like
3Likes
Like

Posted 09 March 2013 - 10:21 PM

I am just hobbyist programmer, but I feel that learning C++ is easier if you already have basic programming knowledge, like what methods are. Otherwise it only depends on your needs, i.e. you ready to learn C++ when you have particular problems to solve.



#15 Yrjö P.   Crossbones+   -  Reputation: 1412

Like
2Likes
Like

Posted 09 March 2013 - 10:27 PM

stein102, on 10 Mar 2013 - 00:14, said:
Well, I already know a fair amount of Java and feel pretty confident with it. But I also know that C++ is the industry standard for Game Programming and that I'll eventually have to learn it.

"A fair amount" can mean anything. What's the toughest / most extensive thing you have actually programmed in Java?

As for the C++ books, "Programming: Principles and Practice" is really good. It starts from zero and talks a lot about programming concepts in addition to the language, so it's fine for people new to programming in general. If you are not a total beginner, then "The C++ Programming Language", also from Stroustrup, would be a fine choice. The 4th edition of TCPL is supposed to ship 20th of May; the previous editions are/were great books but are not worth getting at this point because the language has evolved tremendously.

#16 _greyfox()   Members   -  Reputation: 1132

Like
2Likes
Like

Posted 10 March 2013 - 01:27 AM

I personally learned C++ first, as my first language. It took me a while (about 1.5 years) to just get grasp of all of it's features.

After that I did some game programming for PC, and then started to learn Java so that I could start programming for Android. , I was suprissed that I learned Java very quickly (it took me about 1 month to get grasp of all of it's differences and new features between C++. And knowing both languages is satisfying feeling, because with those two, you can understand almost every other popular programming language like C or C#.


“There are thousands and thousands of people out there leading lives of quiet, screaming desperation, where they work long, hard hours at jobs they hate to enable them to buy things they don't need to impress people they don't like.”― Nigel Marsh

#17 Alpha_ProgDes   Crossbones+   -  Reputation: 4688

Like
2Likes
Like

Posted 10 March 2013 - 01:45 AM

Personally, I would do check for the following:

 

  1. Do I know the current language I'm using relatively well?
  2. Have I made games (finished and running) in this current language?

If yes, to both answers, then go on to learn another language. If no, especially to #1, then maybe you should hold off. Switching languages too quickly often makes matters worse, not better.

 

In short, IMO, stick with Java and make games in Java. Once you've done that, then learn idiomatic C++. It'll be easier and you'll already have two skills under your belt when you start learning idiomatic C++. OOP and game dev. :)


Beginner in Game Development? Read here.
 
Super Mario Bros clone tutorial written in XNA 4.0 [MonoGame, ANX, and MonoXNA] by Scott Haley
 
If you have found any of the posts helpful, please show your appreciation by clicking the up arrow on those posts Posted Image
 
Spoiler

#18 blewisjr   Members   -  Reputation: 620

Like
2Likes
Like

Posted 10 March 2013 - 04:41 AM

The key is do not be scared of c++. You do not need to move to it if you want to learn it do so. Do not let other people tell you what language you have to learn if it interest you just do it. Look at me do instance I know many languages but I do not know any better than I know C because I love it. People tell me c++ is better and I should learn that but I really don not want to because I have no real need to do so.

#19 RobTheBloke   Crossbones+   -  Reputation: 2325

Like
4Likes
Like

Posted 10 March 2013 - 05:00 AM

 But how will you know when it's time to move on to C++?

 

It'll take 10 years to fully understand it, so there's no harm in starting to learn it now.



#20 Fredericvo   Members   -  Reputation: 284

Like
1Likes
Like

Posted 10 March 2013 - 05:45 AM

I knew assembler before I knew C and C before C++. I understood pointers already thanks to assembler and curiously found the C/C++ way to approach them more convoluted because of the complex syntax. Looking at assembly output helped me understand what compilers do and get the language better.




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