Learning C++

Aardvark Soup

New member
Jul 22, 2008
1,058
0
0
Don't. C++ is an absolutely awful language with which to start learning how to program. Even those who really like the language (I'm definately not one of them) will probably agree that it is not a good idea to learn programming with a complex language in which you have to manually manage memory and in which an bug will often result in 'undefined behavior', rather than just halting your program and providing you with an error message.

If you want to make games and learn a little programming along the way, I would recommend something like Game Maker or Unity.

If you want to learn programming, I recommend starting with a scripting language such as Python, Ruby or Javascript. You could also start with a statically typed and object-oriented language such as Java or C#, which may have a slightly higher barrier to entry, but are still very suitable for learning how to program.


I'd also like to point out (a summary of) Yossi Kreinin's critism of C++ as a language:

http://yosefk.com/c++fqa/defective.html

He makes some very good points as to why C++ is a badly designed language in general and why you should avoid it as much as possible.
 

surg3n

New member
May 16, 2011
709
0
0
I'd suggest trying a game orientated language first, get the basics down, and more importantly - get an idea for what you want to achieve in C++. C++ is best learned when you have an actual necessity for it. With modern PC's, or even basic PC's, you don't really need the speed benefits of C++ these days. A lot of people prefer to use languages that support different platforms, have built in, standard sprite systems and physics. For example, App Game Kit (AGK) is a 2 tier system, it's a BASIC language that is easy to learn, has built in Box2D collision - so making an Angry Birds game for example is a piece of cake. But it also exists as a C++ library, so learning the BASIC then moving onto C++ with that is what I'd do.

http://www.appgamekit.com/

I'd suggest coming up with a game idea for 2D first, 3D math and media creation takes a lot more time. Try and think of something simple yet interesting. The most valuable learning comes from necessity, so if you need to know how to do a specific thing, it's a lot easier to learn than if your just messing about.
 

Colt47

New member
Oct 31, 2012
1,065
0
0
C++ in a college/university driven learning environment (meaning you get pushed hardcore) will take two semesters to get through for the basics, and a third semester learning how to make use of the STL library as well as algorithms. The reason people don't recommend it as a first language for self learners is due to pointers and manual garbage collection: Basically C# and other high languages handle memory in an automatic fashion, which takes a lot of pressure off the programmer. C++ requires the programmer to master some basic memory management techniques in order to succeed, which increases the amount of code that needs to be written.

Also, C++ was created as an academic language during the transition from procedural programming to object oriented programming and covers concepts found in both kinds of programming. It is used in micro architecture where memory and resources are an issue, such as micro-controllers, and is the primary language used for Arduino.

C# and Java on the other hand, are primarily written to shortcut the development time for primary computer programs and are heavily used in business applications as well as games. Heck, with a bit of CLS/CLR magic it's possible to do memory management with C#.
 

HDi

New member
Aug 23, 2010
72
0
0
I'll throw in a suggestion for Processing (processing.org) as a great place for a beginner.

It's based on Java, and used pretty much only for motion graphics, but it's immediate and gratifying ...you spend your time making flashing lights and self generating patterns and learn the fundamentals of programming in the process.
 

jlemay

New member
Apr 12, 2013
1
0
0
A bit late, but I'll respond anyway.

The first thing you need in order to learn C++ is an IDE (Integrated Development Environment). This just means software that contains a text editor, a debugger, and a compiler. On Windows, two good examples are:


Microsoft Visual Studio


The most popular one. The "Express Edition" is free, and more than powerful enough for students. I'd recommend using the 2010 version to start.


Code::Blocks


Excellent open-source software, but not as common.




Once you have that, you can write some basic applications. Using external libraries will be more complicated, but you don't need to worry about that at the start.

cplusplus.com [http://www.youtube.com/watch?v=kW14wVNIgWM&list=PLRwVmtr-pp056ahRbFrYbeAnIu2qvXPFe&index=1], which will teach you the fundamentals.

After that, I would look up the other playlists [http://www.youtube.com/user/1kingja/videos?tag_id=&sort=dd&shelf_index=0&view=1] pertaining to C++ on King's YouTube page (starting with C++ Miscellaneous). He also has another series of videos on "Game Engine Development" (the title is a big vague, but essentially you learn to use a few libraries in order to create a small game).

You don't need to know any other languages to learn C++. But if you find it a bit too hard, you could start with a simpler one like JavaScript, which is very accessible and easier for beginners.
 

devotedsniper

New member
Dec 28, 2010
752
0
0
Like some others have said learn another language first, when you know one language it's fairly easy to pick up others, C++ is a bit of a ***** at times, it's not very forgiving and leaving memory leaks everywhere will not make your computer very happy. I started off with Java and Visual Basic but moved on to C# (as well as SQL for databases) for my final year project for university and found it the easiest to work with.

I should also mention that the big tools your probably thinking of using like directx for your game do have C# support, not to mention that it has become very popular lately, so popular I managed to secure a C# dev role for my first job out of uni for web based and desktop applications. Also if you pair it with a toolkit such as Visual Studio (never used the free one but I hear its good enough for beginners/intermediate work) you'll pick up the language fairly easily.

C# might not be considered as powerful as C++ but you can still pull off some amazing things quickly and easily. I wish you luck if you continue to plan to learn C++ first but I really don't advise it for the sort of things you'll be making for the first few months/years a higher level language is more suitable.

Feel free to PM if you have any questions.
 

Calcium

New member
Dec 30, 2010
529
0
0
I still have yet to learn C++, though have experience with Python, Java, Matlab, Haskell, a little SQL and C. I imagine there must be a C++ version, but "Head First Java" is beginner friendly and rarely for a textbook, actually holds my interest.

There'll be plenty of free guides and tutorials you can find online too I imagine, though I'm more inclined to refer to APIs rather than tutorials.
 

Esotera

New member
May 5, 2011
3,400
0
0
If you're learning programming just to create a game, I'd recommend using the Unity3d engine instead & scripting either with Javascript or Python. It's a lot simpler than creating your own game engine.

C++ is probably the hardest thing you can start off other than Assembly, but it will teach you a load of useful concepts such as types that higher-level languages conceal. Buy the C++ programming language by Bjarne Stroustrup, that'll serve as your reference manual. And the best thing you can do is ask questions, answer questions, read stackoverflow, and practice a whole lot!

Also there's each programming language has its different advantages & disadvantages, which might suit certain projects better. Learning several languages is not something to be afraid of & is probably going to be essential if you end up doing anything serious.
 

Adam Jensen_v1legacy

I never asked for this
Sep 8, 2011
6,651
0
0
As some of the posters stated, don't. C++ is not a good starting point. At all. You'll end up a frustrated and broken man. You will likely turn to alcoholism and drugs. Start with C# or Java first and do it slowly. Make sure that you fully understand everything you're learning before proceeding to the next level.
 

BreakfastMan

Scandinavian Jawbreaker
Jul 22, 2010
4,367
0
0
If you want to make a game easy, C++ is not your friend. C# or Python would be more up your alley, and they are much easier to learn for beginners than C++. So, my advice is... Don't.

And yes, this is coming from a C++ fanboi AND a guy who is finishing up a bachelor's in CSS, so I know my shit. :p
 

DoPo

"You're not cleared for that."
Jan 30, 2012
8,665
0
0
FreedomofInformation said:
Aren't there more modern languages that are better than C++ or has it stuck around for the same reasons as the qwerty keyboard.
Erm...yes and no. There are better languages for some stuff, but I don't think anything beats C++ at being C++.

Besides, there are approximately a metric shitton of libraries, frameworks, tools and support for it available - why would people just throw them out? Why would you want them thrown out? The only reason would be if anything takes over but why reinvent the wheel?

Finally, it's not just an archaic monstrosity like COBOL or FORTRAN, it's being revised and new standards come out - the latest one is from 2011 (C++11), the previous one was C++03, I believe the next standard currently being discussed is C++14. Which means that it's at least a modernised monstrosity.

Your post perplexes me. Programming languages are not a hammer, you've got a toolbox of them.
 

Buzz Killington_v1legacy

Likes Good Stories About Bridges
Aug 8, 2009
771
0
0
DoPo said:
Finally, it's not just an archaic monstrosity like COBOL or FORTRAN, it's being revised and new standards come out
Fun fact: the most recent COBOL standard was issued in 2002. It includes object orientation and support for running in .NET and JVM environments. (Yes, really.)

The latest FORTRAN standard dates all the way back to 2010.
 

Weaver

Overcaffeinated
Apr 28, 2008
8,977
0
0
I'd argue C++ is becoming less and less relevant outside of embedded software.
It's a very unfriendly language with ugly syntax and a ton of gotchas. However, it has a lot of power to it and in the right hands can do some fantastic optimization. Most compilers will let you "get away" with really hacky stuff; but I'm not sure I'd recommend learning programming in it.

That said, Basic and C were my first two languages. THAT said, I can see the value of learning programming in a memory managed language.
 

DoPo

"You're not cleared for that."
Jan 30, 2012
8,665
0
0
Buzz Killington said:
DoPo said:
Finally, it's not just an archaic monstrosity like COBOL or FORTRAN, it's being revised and new standards come out
Fun fact: the most recent COBOL standard was issued in 2002. It includes object orientation and support for running in .NET and JVM environments. (Yes, really.)

The latest FORTRAN standard dates all the way back to 2010.
Huh, didn't know that. How widely are they used outside legacy systems, though? Because any time they get mentioned, I picture some horrible system that shakes it cane at the whippersnappers listening that small garage band Metallica.

AC10 said:
I'd argue C++ is becoming less and less relevant outside of embedded software.
Yeah, I think it does. Well, it's still up there [http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html] in the top five (for what it's worth) but I think other languages are getting more and more usage. Especially Java and Objective C for mobile apps and web languages are getting more and more popular..
 

unstabLized

New member
Mar 9, 2012
660
0
0
I'm going into Computer Science for my University program, and I can tell you this. Jumping into C++ instantly with no background experience isn't an amazing idea. I'm interested in the language myself because I hear a lot of things about it, but I don't dare go near it yet. I've worked with Turing, Python, BlueJ and Eclipse so far. So far, I've liked coding with Eclipse best, because it told me what my errors were and where they occured, and I could google and research the error. Was fun programming with it this year.
 

The Lugz

New member
Apr 23, 2011
1,371
0
0
Coding in c++ entirely..
that would be a bit of a ballache and quite intensive for your first piece of code, but it would probably end up being extremely efficient as c is generally considered to be a very efficient language you can do more with custom code, if it's a small project that is

if it's going to be a 9 hour epic, with 3d models then definitely go with an established engine.. setting up everything yourself will KILL you.

I made my own text adventure, and rpg in python once it was extremely fun and rewarding i suggest that for a starting point in all honesty.

a step up from that might be modding an old game, or something with developer mod support, like skyrim ( it's easier than it sounds ) and working with the 3d system before you get your hands dirty and build something from scratch

i hear unity is really good for that, but i've no experience in it myself.. so don't ask.

i haven't gotten to these steps yet, i've gone to university to learn programming the 'proper' way so it'll take longer but i'll have all the background knowledge to do it really effectively
i also suggest this.
it's really amazing what you don't know about a computer until you study one in a full on learning environment.

also, my university programs in python.. just a hint.