Jump to content

  • Log In with Google      Sign In   
  • Create Account

Is c++ good


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

#1 RaoulJWZ   Members   -  Reputation: 1303

Like
2Likes
Like

Posted 14 July 2014 - 12:22 PM

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.

 



#2 ApochPiQ   Moderators   -  Reputation: 20088

Like
14Likes
Like

Posted 14 July 2014 - 12:32 PM

That depends a lot on the kind of games you want to make.
Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

#3 Glass_Knife   Moderators   -  Reputation: 8415

Like
21Likes
Like

Posted 14 July 2014 - 12:35 PM

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


#4 fastcall22   Crossbones+   -  Reputation: 8916

Like
12Likes
Like

Posted 14 July 2014 - 12:56 PM

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).
gzip: H4sIAAAAAAAEAG1QTUvEMBC991e8nvaiFfYoS7yo sLCo6MnjtJ1ugmkiyWRL/72z3T1YEQIJ8z4zA2Xp yPvt1qBpGrRFIJZkk9FyRyUzHCbKIHgn4hnZOrm1 TD0mG0HCCs+QGDGWziKXI6Wm2n++GYwUVH2mrGEE PnGCVQ8K8+JYfXA6URDEQfMZh5h6g5eoAlWJdeEI bbH2qYZf7XMUfw8f/Q0oMeZYNL9/WHF0uFEshvMr XYujd9SycFb+F18QcSOvlJauZ8ejqevdnV7/d550 e0t6prmunh73Bu+vz4c/XUeOQXfJgvKNkhf95U8/ Dtgmy5IBAAA=

#5 ferrous   Members   -  Reputation: 4970

Like
8Likes
Like

Posted 14 July 2014 - 01:01 PM

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.



#6 Washu   Senior Moderators   -  Reputation: 7585

Like
19Likes
Like

Posted 14 July 2014 - 01:37 PM

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.
ScapeCode - Blog | SlimDX


#7 SeanMiddleditch   Crossbones+   -  Reputation: 15113

Like
13Likes
Like

Posted 14 July 2014 - 02:25 PM

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.

#8 DvDmanDT   GDNet+   -  Reputation: 1515

Like
4Likes
Like

Posted 14 July 2014 - 03:12 PM

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.



#9 mark ds   Members   -  Reputation: 1678

Like
4Likes
Like

Posted 14 July 2014 - 03:31 PM

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.



#10 blewisjr   Members   -  Reputation: 750

Like
2Likes
Like

Posted 14 July 2014 - 06:09 PM

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.



#11 Buster2000   Members   -  Reputation: 3777

Like
0Likes
Like

Posted 15 July 2014 - 01:29 AM

C++ is basically the latin of programming languages.  Its usage (outside of games) is getting smaller and smaller but, it is the go to language that a lot of companies still use for programming tests (even for PHP or Java programming jobs).

It is a powerful language but it is also a language that is full of pitfalls and gotchas.  It is still used by most AAA companies along with some kind of scipting language but for an indie game like the ones that are advertised in the classifieds they are constrained by small team sizes, finances and time so they will tend to use established games engines that will use a higher level language.

 

 

 


understand C++ can transition to most other languages (expect functional)

 

 

Functional programming is just a paradigm and C++11 supports programming in a functional style so why you assume somebody who fully understands C++ would have trouble I don't know.

 

 

 

 


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.

 

Theres no reason why somebody who has used any of these languages would not understand C++ code.


Edited by Buster2000, 15 July 2014 - 01:30 AM.


#12 Tribad   Members   -  Reputation: 981

Like
0Likes
Like

Posted 15 July 2014 - 02:03 AM

I think that it is all alike.

 

The biggest problem for someone who is new to any of the cited languages is the object oriented design. So the focus should be on the question how can you learn that. With the knowledge of OOD the languages all are quiet easy to use.



#13 RaoulJWZ   Members   -  Reputation: 1303

Like
0Likes
Like

Posted 15 July 2014 - 02:21 AM

Okay thanks everyone.
I'll stick to c++ for a while.
If it Will be too hard i go for c# then to move on later to c++

#14 SeraphLance   Members   -  Reputation: 2325

Like
2Likes
Like

Posted 15 July 2014 - 03:17 AM

C++ is still the lingua franca of the AAA space in gamedev, and it's still very popular in smaller-budget / indie titles (except on the web browser), but it's been somewhat displaced by things like Unity (which is probably like 80% of the C# game developers).
 


C++ is basically the latin of programming languages. Its usage (outside of games) is getting smaller and smaller but, it is the go to language that a lot of companies still use for programming tests (even for PHP or Java programming jobs).

 

I don't think I've ever been asked a C++ question or asked to write any C++ code for a job that didn't involve C++.  Usually it's "X language from the job listing" or "whatever you want".

 


Functional programming is just a paradigm and C++11 supports programming in a functional style so why you assume somebody who fully understands C++ would have trouble I don't know.

 

This is a bit un-topical, but C++'s "functional style" doesn't really prepare you all-too-well for full-blown functional programming.  Great, you know how map, filter, and reduce work.  You're not going to pick up more fundamental things like Lazy evaluation, continuations, or monads.

 


Theres no reason why somebody who has used any of these languages would not understand C++ code.

 

This I have to disagree with vehemently.  Many of the similarities between C++ and Java/C# (Javascript is a totally different beast) are superficial.  Templates are far more powerful, expressive, and hard to figure out than the comparatively simple generics in the aforementioned language.  What the hell is a foo<1>?  What do you think a java programmer without any experience will do when he sees this?  The reference semantics are different too.  It's easy to see "std::vector v;" and say "oh, that must be how C++ programmers use new."  In most cases, it is.  Then they try to return it by reference, and the world breaks.  This is assuming you haven't tried to screw with their head by throwing pointers at them.



#15 Tribad   Members   -  Reputation: 981

Like
0Likes
Like

Posted 15 July 2014 - 03:28 AM

If I have switch from one language to another I do not try to read something right from the start. It must fail if it goes over the simple control statements and assignements.

I try to make simple programs like the hello world to ask the question "in C++ it is called x and done this way. How is it done in java, C# or any other language".



#16 MarekKnows.com   Members   -  Reputation: 1030

Like
0Likes
Like

Posted 15 July 2014 - 06:45 AM

I learned a few languages before picking up C++ many years ago, but I noticed that after I learned C++, all other languages were much easier to pick up since a lot of concepts in C++ were easy to carry over to other languages.  


---
Free C++, OpenGL, and Game Development Video Tutorials @
www.MarekKnows.com
Play my free games: Ghost Toast, Zing, Jewel Thief


#17 Karsten_   Members   -  Reputation: 2087

Like
3Likes
Like

Posted 15 July 2014 - 08:54 AM

Theres no reason why somebody who has used any of these languages would not understand C++ code.

I dont know... C++ has an automatic memory management system (RAII) that is quite different from other languages (especially ones needing a GC). Even though developers new to C++ may be able to understand what the C++ code does, I don't know if I would trust that their code is safe and correct.

 

But I could be wrong. Apple has proven that if you make a language trendy and cool enough (Objective-C), no matter how low level and complex it is*, even beginner developers are very capable and productive regardless. Better still, many beginner developers are quite happily cross compiling to restrictive ARM devices and remote debugging. Something that is quite a step up from what I was doing when I was starting out (VB6) ;)

 

* no garbage collector (Apple deprecated it), pointers, possible undefined functionality, exposure to C-style memory management.


Edited by Karsten_, 15 July 2014 - 10:40 AM.

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


#18 Buster2000   Members   -  Reputation: 3777

Like
0Likes
Like

Posted 16 July 2014 - 01:00 AM


Buster2000, on 15 Jul 2014 - 08:29 AM, said:

Theres no reason why somebody who has used any of these languages would not understand C++ code.

I dont know... C++ has an automatic memory management system (RAII) that is quite different from other languages (especially ones needing a GC). Even though developers new to C++ may be able to understand what the C++ code does, I don't know if I would trust that their code is safe and correct.

 

I think an experienced coder who has used any language should be able to read the code from almost any other language and be able to fatham what the code is doing.   The finer perculiarities of the language syntax maybe not but it shouldn't be too difficult for them to figure out.  I am of course talking about an experienced coder and not somebody who has spent a few months learning a little C# and now calls themselves an expert.

 


Buster2000, on 15 Jul 2014 - 08:29 AM, said:


C++ is basically the latin of programming languages. Its usage (outside of games) is getting smaller and smaller but, it is the go to language that a lot of companies still use for programming tests (even for PHP or Java programming jobs).



I don't think I've ever been asked a C++ question or asked to write any C++ code for a job that didn't involve C++. Usually it's "X language from the job listing" or "whatever you want".

 

I have by several companies including Microsoft, Facebook and Yahoo.  Also outside of the games industry I haven't seen many jobs that say you must know X language.  Once you get to a senior position they pretty much all say you must be a full stack developer who can handle any language that we throw at you.



#19 fir   Members   -  Reputation: -464

Like
0Likes
Like

Posted 16 July 2014 - 01:35 AM

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) 

 

Imagine what it would be if c++ would not hold the backward compatibility ;/

Then you will have 

1) two wersions of c++ in the run (which would will make some to revrite millions of lines probably etc)

2) as the previous c++ would be marked obsolete it would effect in the thing called 'code rot' imo both versions of c++ older and younger will be suffering on this

 

This is even now present by publicing the changes and staying backward compatible - but if it would drop backward compatibility it would raise much more

 

(for some case it is fun/silly of standarization comitee to produce different versions of language, the standarization was born exactly to deny the multiplity of close but not compatible versions and problems and space poluttion 

that it makes - then standarization comietee was starting 

to make those uncompatible verions theyselves ;/ this is

a bit sick) - the one thing that helps with this kind of problems is backward compatibility as you may still use core language (i mean older version and its still alive

 

same think i dislike the rotting proces of opengl (first ogl version was sentenced rotten to the bone, then we have 

the second about wich i cannot be sure will not rot as well

- this makes me feeling a bit disrespectfull to that as i could

respect more some real stable environment and system for decades


Edited by fir, 16 July 2014 - 01:49 AM.


#20 kunos   Crossbones+   -  Reputation: 2252

Like
2Likes
Like

Posted 16 July 2014 - 01:43 AM

One thing I find "difficult" dealing with C++ is that it is a big big monster with different heads. You say "C++" but which one? Every C++ codebase I have come across uses a different subset of the language, completely different coding styles and guidelines.. and the more they add to the language the more this become evident.

More modern languages seem to have a better appreciation about coding standards and the importance to promote a clear style that identifies a language. Java comes with a style both "visually" (where the braces go, how you name things, which case you use) and logically.. with the standard library promoting that style. C# is even more on the same line.. Go is forcing the idea of "the one true way to Go". I have been writing C++ for almost 20 years.. I look at Unreal Engine 4 and my eyes hurt... it;s not nice and it wouldn't happen in a more modern language.






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