#1 Posted by DillonWerner (1526 posts) -

I'm just a normal guy trying to learn C++, anyone know of any good tips, books, or tutorials anywhere that are actually worth investing time into?f Any help is appreciated.

#2 Posted by PerryVandell (2103 posts) -

Never forget your semi-colons. EVER.

#3 Posted by thekingoftoilets (191 posts) -

Practice your loops. Oh, and depending on the length/complexity of the program you are going to create, it goes a long way to first create a diagram of some sort. This website helped me answer a lot of questions I had when errors popped up or I needed help cultivating my thoughts unto my program. GL man :D.

http://www.cpp-tips.net/

#4 Edited by tourgen (4474 posts) -

"C++ Primer Plus" isn't bad.

I like http://www.cplusplus.com/ as a reference for the STL containers and the C standard library.

My tip on C++: Just because it's in the language doesn't mean you should be using it.

I would ignore templates, operator & function overloading, and class inheritance when you start. Heresy I know. Everyone grovels at the alter of OOP but it's not all that until you get into large-ish projects. For small projects it's just added typing at the keyboard for 0 gain.

Most hobby stuff can be done just fine with just the basics - standard C functions with some basic C++ classes where it makes sense, and the STL containers & streams. Learn the class inheritance stuff after you've finished a few simple functional projects.

P.S. new & delete are kinda busted so watch out. Also, I'm just a normal guy that has to write some tools at work - so by no means a programming professional. Just some hard-learned lessons over the years.

#5 Posted by DillonWerner (1526 posts) -
@tourgen:  Glad there is two of us, thanks for the tips
#6 Posted by benpicko (2005 posts) -

Watch thenewbostons C++ tutorials. He's very obviously just reading some C++ book, but he makes it easy to understand.

#7 Posted by recharge330 (80 posts) -

I second C++ Primer Plus, I'm just now finishing it up. Like tourgen said, there is a lot of stuff in C++ and the book covers a lot of it but don't feel like you have to memorize every last thing. Just be aware of what the language is capable of. Two other things I recommend are to try any project that comes to mind and forgetting IDEs for now and just use a basic text editor.

#8 Posted by EmuLeader (558 posts) -

@PerryVandell said:

Never forget your semi-colons. EVER.

This, and really make sure all brackets are closed. Nothing is worse than trying to compile a program an seeing the entire screen fill with errors, only to find a bracket was left open. Visual studio is actually a good IDE to use once you get the hang of C++. Makes things alot easier to debug.

#9 Edited by RadixNegative2 (511 posts) -
#10 Posted by Dagbiker (6972 posts) -

www.gamedev.net

also good luck.

#11 Posted by Elbon (368 posts) -

Once you get the basic of the language down learn the design patterns

#12 Posted by DillonWerner (1526 posts) -
@ashkanhoss29: I want to be some sort of programmer for a job, and I'm learning C++ because my friends have told me that it is the best  language for programming.
#13 Posted by MistaSparkle (2148 posts) -

@benpicko: Bucky was really great for me, but i wish he would continue his game programming tuts!!!

#14 Posted by juanvaldes (184 posts) -

Do you have any programming experience? What is your end goal? Learning for the sake of learning? Want to "make games"? Tool for work? Web apps? Want to make the next Angry Birds?

Honestly going with the assumption that you are starting with step one C++ would not be my first language. Javascript is a quick and easy way to get into programming, learning the basics of logic and control flow and a simple way to "see" the results of your efforts. Other easy to start with language would be scripting languages like PHP, Ruby and Python.

C++ has its place and every serious programmer should learn it at some point along with plain C but it does have many pitfalls that the above mentioned languages do not have. This would free you to learn the basics first before dealing with hardcore memory management. Again it all depends what you want to do.

I will echo the C++ Primer Plus support. No clue what edition it is at now but I still have my copy from high school thats now over a decade old.

#15 Posted by RadixNegative2 (511 posts) -

@DillonWerner: Ok cool. I would agree with your friends. I also started with c++ and think it's a great language.

Thinking back what made learning programming for me so difficult was that I would learn about c++ if statements, loops, etc., but never understand how to put the pieces together because I would just blindly follow tutorials. I have come to learn that designing programs is as important as writing them.

It's important to push yourself in your designs so that you learn. If you don't push yourself and just follow tutorials, you'll have a very difficult time learning.

#16 Edited by MonetaryDread (2018 posts) -

  I am going through this right now. It is a legit course from MIT that does a pretty phenomenal job at introducing you how to think like a programmer.  You learn to to read and write code, the abilities and limits of coding, and to take a description of a problem and map it into something computational.  
 
Edit:  It's focus is on python, but everything I have read about computer science says that python is one of the best to learn with.
#17 Posted by Dark_Swordmaster (28 posts) -

I would have recommended www.learncpp.com but they seem to be down right now. I've been using them for the past few months and I would highly recommend the site, it's basically like an online textbook with end-of-chapter quizzes and such to help make sure you've learned it. The comments section of each chapter also tends to be very helpful.

#18 Posted by EdIsCool (1122 posts) -

C++ should never be your first language. You will be much happier with the results you achieve when learning the basics if you use c#.

If you want the best balance of making something cool while still learning good coding lessons I would make games using the Unity engine for windows. Its free and you can script with c#.

C++ is the fastest main stream language, it is also a minefield.

#19 Posted by Zidd (1841 posts) -

The best tip I can give you is "Always be commenting your code". Theres nothing worse then coming back to something you previously wrote and wasting a bunch of time reading it line by line to figure out what its supposed to do. This goes double while you are learning.

#20 Posted by eshchan (47 posts) -

Not sure what you want to do with your programming skill. Nowadays c++ is used for game engines and native tablet programming. It's a nice foundation to your programming skill to build on with other language, but know that if you aren't building rage or angry birds you will need to learn other programming language.

#21 Edited by Warchief (657 posts) -

@DillonWerner said:

I'm just a normal guy trying to learn C++, anyone know of any good tips, books, or tutorials anywhere that are actually worth investing time into?f Any help is appreciated.

Recently I got sick of the work I was doing and decided to find a entry level programming job with a local game developer. Here are some of the things I did to get myself up to speed with C, C# and programming concepts in general.

First off make it fun for yourself, it makes learning things a lot easier, so in that regard:

My first suggestion would be to pick up an Arduino micro controller. The Arduino is a open source micro controller that runs a variant of C on the board. Pick up "Getting Started with Arduion" and run through the examples in this book. The Arduino is a fun way to learn programming, and the book will teach you how to set up programs, use loops and simple logic for the controller.

Other Arduino books:

Practical Arduino

30 Arduino Projects for the Evil Genius

Next you may want to look into the book "Head First Programming" now granted this book uses python to teach you the basics of object oriented programming but its a great way to get more key concepts.

Lastly [and this is where our paths would differ] I read the book "Head First C#" to get an understanding of C# [this is the next leap up from C++] because I deal mainly with web servers.

Hope this helps. Good Luck Have Batman.

#22 Posted by theguy (796 posts) -

Comments. All comments all the time.

#23 Posted by kashif1 (1428 posts) -

Try Java instead? Seriously c++ is not a good place to start with programming, learn the basic concepts in something easier such as Java or VB and then if you feel like you need to you can move on to c.

#24 Posted by Vodun (2370 posts) -

Play Quake during any C++ class you take. It's what I did and now I work as an interaction designer. Oh, you meant you actually want to learn? No idea!

#25 Posted by Grumbel (910 posts) -

If C++ is your first languages, stop trying to learn it and learn some Python first. C++ really isn't suited as first language and will just lead to frustration as it forces you to learn to many concepts at once. If you already have some experiences with other languages, you could probally pick up the classic "The C++ Programming Language" book and go on from there, but it's really only recommend as a second or third step in the world of programming, not a first.

#26 Edited by VanillaPlant (146 posts) -

@Grumbel said:

If C++ is your first languages, stop trying to learn it and learn some Python first. C++ really isn't suited as first language and will just lead to frustration as it forces you to learn to many concepts at once. If you already have some experiences with other languages, you could probally pick up the classic "The C++ Programming Language" book and go on from there, but it's really only recommend as a second or third step in the world of programming, not a first.

This. In fact, I would suggest you first spend some time with both python and C before C++. You don't need to master these languages, just become comfortable with their syntax and how to preform some basic tasks. Python is a much more approachable language than C++ and is great for learning the fundamentals. Next, learning some C will give you a much better understanding of the low level operations in programming, and much of what you learn in C will translate directly into C++. Also C is sort of the lingua franca in programming because it has been in use for over 30 years; so you should become comfortable with it if you are at all serious about programming.

You can find all the tutorials you need for free online:

Python: http://docs.python.org/tutorial/

C: http://www.cprogramming.com/tutorial/c/lesson1.html

If you want a book, then get: http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628/ref=sr_1_1?ie=UTF8&qid=1317746831&sr=8-1 It is THE book for learning C and is also great for reference.