Is c++ good

Started by
30 comments, last by aggieblue92 9 years, 9 months ago

Hello everyone,

About a week ago i started learning the basics of c++.

I know it's a long hard way, but my ultimate goal is to make games.

For fun i just looked to the classifieds page and there i saw that most people,

who need a programmer. Need one who knows c#. My question is: is c++

still so good for game programming?

Thanks.

Advertisement
That depends a lot on the kind of games you want to make.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

The thing to keep in mind is that C++ is one of the most difficult programming languages in use today. However, if you are willing to put in the extra time, it will be worth it. Someone who really understand C++ can transition to most other languages (expect functional) with ease. C# will be a lot easier to understand if you know C++.

But it doesn't work the other way. Take someone who knows C#, or Java, or Javascript, and show them some C++ code. They will not understand it.

And someone correct me if I'm wrong, but C++ is still the most used language for game programming.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

If you're worried about "wasting time" learning C++, then stop worrying. The most important thing you can learn while learning a language is learning the concepts of programming themselves. Once you've picked up these concepts, it's only a matter of learning how a language describes those concepts (and sometimes the syntax).

But it doesn't work the other way. Take someone who knows C#, or Java, or Javascript, and show them some C++ code. They will not understand it.

Heh, actually, to be honest, all of those languages look mostly the same. C++ can do some crazy things, and can look amazingly ugly, but its typical usage isn't all that different. Std::Vector is a lot like List<> in C#, etc. Yes, certain places will totally throw your typical C# or java guy, but if they had to look over an entire codebase, I'm sure they'd be able to pick up what a lot of places were doing.

C++ is a fine language to learn, and as long as you keep in mind that it will be a long and twisty road to get through it, you should be fine. It is not an easy language, and C++11 certainly has not improved the number of corner cases at all. That being said... as long as you're learning modern C++ you should be fine in the long run. That being said, you do not need to use C++ to write games, you can write games in ANY programming language.


The thing to keep in mind is that C++ is one of the most difficult programming languages in use today. However, if you are willing to put in the extra time, it will be worth it. Someone who really understand C++ can transition to most other languages (expect functional) with ease. C# will be a lot easier to understand if you know C++.

Some languages will be easier to pick up on, yes. But in reality its not about "learning C++ makes you good at learning other languages." Its about the fact that learning any programming language... and more importantly the ART of programming, which is language agnostic, will enable you to more easily pick up future languages.


But it doesn't work the other way. Take someone who knows C#, or Java, or Javascript, and show them some C++ code. They will not understand it.

I have met (and hired) many programmers with a diverse number of backgrounds, and frankly... pretty much every single one of them could parse any program in any language. They might not know the SPECIFICS of what is going on, but they can reason their way through it and figure out what the program does and even how to modify it. C++ doesn't magically make you better at this.

And someone correct me if I'm wrong, but C++ is still the most used language for game programming.

Yes, but not due to performance reasons or any of the other common excuses people give. Frankly, its more that there just isn't another language out there that is A) supported on all of your target platforms and B) supports all of your legacy frameworks and existing code artifacts. When you have an enormous amount of pre-existing code and tools to work with, then you will find that most businesses are not interested in moving to another platform where they're going to have to rewrite or port a large portion of that code. You also have the simple problem of: If you're shipping a console game... it needs to be in a language that the compiler for the console supports. In general that's C and C++.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

C++ is more typically used in big AAA game development. Unity has kind of swallowed the indie/mobile/entry-level games market and so a lot of game development these days is done in C#.

Mostly, if you learn C#, you'll be able to pick up C++ easily. Likewise, if you learn C++, you'll be able to pick up C# easily.

A notable problem in C++ is that it recently had a pretty big overhaul and almost all of the documentation, tutorials, books, and learning material you'll find for it are for the older version. All the old stuff still works (C++ is very big on maintaining backwards compatibility, which is a source of most of its warts and ugliness) but you really want to use the new stuff both because it changes the way you write idiomatic C++ and it makes a lot of things much easier and simpler.

If you're interested primarily in games and don't have a strong group of people around you to learn from/with, my strongest recommendation is to instead focus on C# for now using Unity. It's a lot easier to keep your motivation up if you can see things on screen right away which Unity will allow. There are similar options in C++ but Unity is free, has tons of documentation, a huge community, and hence has a lot of advantages when it comes to use as a learning tool.

Sean Middleditch – Game Systems Engineer – Join my team!

As I said in another thread, C++ is IMHO a language every programmer should know but almost none should use. Learning it will teach you a great deal about the lower levels, but it's incredibly annoying and unproductive to use, mostly for historical reasons. C# (and many other languages) got a fresh start in the modern days and is much easier to use. Programming is hard enough as it is.

Choose the language you're most comfortable with - you'll get a lot more done in a given amount of time. Personally, I prefer a hybrid between C & C++ (often called C with objects). I find it easy to write clear code, which largely self documents, and I find it aesthetically pleasing. This is obviously totally subjective.

Some people will tell you that C/C++ will offer better performance, but the truth is that well thought out and efficient algorithms gain far more performance (in any language) than micro optimisations performed at the last minute.

I agree with most of the comments here. C/C++ are great to learn to use but they are fazing out in a lot of more common areas. They still have their place and will probably have their place for a very long time yet to come. Learning will make you a better programmer overall even in more modern languages. For games you really do not need C++ or C. There are lots of great technologies out there today that are beyond capable of keeping up. Heck even today much of the games you play are done with scripting languages and those languages hook into the C++ rendering engine on the backend.

The main reason I say C/C++ will be for around for a long time is mainly because of specific areas like kernel development as well as embedded micro controller development. Sure there are new languages coming out that are compiled to machine code like Google's Go. The big downfall of those types of languages is the lack of direct memory access through pointers and direct interfacing with assembly code. In the world of Kernels and embedded micro controller (think ARM Cortex M, PIC, AVR) you really need that otherwise you can't really do anything without extreme C interfacing hoops. Some of those chips are so tiny in memory you would be lucky to get a runtime driven language on them. These are extreme cases.

So in the end if you are learning your first language I would recommend it not be C++. I would rather see a new programmer on their first language use pure C, C#, Java, or Python. C is a very simple language to learn and will let you learn some really useful concepts this is still my all time favorite language. C#, Java, and Python are also relatively simple languages that rule out memory management and will allow you to focus on core algorithm concepts. Choose something you want to choose not what everyone forces you to choose and stick with it for a while before moving on. Every language you learn will teach you something new.

This topic is closed to new replies.

Advertisement