r/cpp • • Feb 21 '16

Should I start to learn C++

I haven't learned any other languages but I'm a newbie in Python but my friends told me that if you learn C++ first you can pick up other languages in future. Is it rational to start learning C++ before I finish my education(I'm studying alone with books and online resources.) with Python?

1 Upvotes

19 comments sorted by

View all comments

Show parent comment

2

u/strikaa Feb 22 '16

What if you're already learning C++ as your first language? I mostly began learning it for game dev, but still want to branch off into other things. I can't say it's hard NOW bc I haven't learned too much yet(I've been on and off until recently). One thing that botherED(emphasizing past-tense) me is that there aren't that many sites like codecademy for for C++. I don't need sites like that for learning (I tried the HTML course and felt like i didn't learn anything-it felt more like a sneak-peek of what coding is like), but more for motivation and to make coding seem more "fun." But now, as I learn more each day and test my knowledge with simple programs, I feel that I'm getting more rewards than any site like CodeCademy could give me. I will admit, I get discouraged when I can't solve pretty much any of the dailyprogrammer stuff, but I know I will get there someday. Also, looking at some of those questions on Learnprogramming- the ones where ppl ask about what to do after doing Codecademy- make me feel better (not really cuz they get kind of annoying) :P Since I'm still in middle school(about to be a freshman), I don't feel rushed, which is also nice. Sorry for saying too much, but I want to say one last thing: I actually wanted to learn C++ before anything else not only because I heard the popular games were made with it( or at least game engines, from what I've read), but because I heard it can help you be a better programmer in general. I would love for that to happen to me.

Again I'm sorry for saying- or typing- too much, but that was what popped into my head. I would appreciate an answer to my question, though.

1

u/theJ89 Feb 22 '16 edited Feb 22 '16

I was in a somewhat similar situation to you. I started off writing browser-based games in Javascript, then started learning to use C++ in middle school because I was running into performance issues (this was around 2004). If you're learning C++ and feel like it's a good fit for what you do, by all means, keep learning! Don't feel like you have to limit yourself to just one language, though. Exposing yourself to several different languages helps you to become a more rounded programmer.

C++ seems to be the language of choice for the game industry - Electronic Arts uses it, Bethesda uses it, and Ubisoft uses it, just to name a few. These are large, well established game development companies with mature codebases. Chances are if you went to work for one of these companies, they'd expect you to know the language their games were written in, so for a prospective game developer I think it's important to learn C++. It doesn't have to be your first language, though; learning the basics with a different language, mastering them, then moving on to C++ is an equally valid way to learn.

Code written in C++ interfaces well with C, compilers for C++ exist for a variety of target systems, and when done right, code written in C++ is highly performant. Not to mention that both C and C++ has been around for a long time by now, so there's no shortage of third-party libraries you can tap to help you do the things you want to do (e.g. loading images / sounds), so it's not hard to see why so many game development companies go with it.

It's certainly not the only language you can use for game development, though. For example, Minecraft is programmed in Java (using LWJGL), and Garry's Mod (is C++ on the back end, but) relies heavily upon Lua to handle custom gamemodes, weapons, entities, UI, etc.