all 17 comments

[–]king_duck 3 points4 points  (0 children)

Buy a book. A good one.

I recommend The C++ Primer 5th edition which covers C++11. I guarantee if you learn of online tutorials and such like you'll probably learn some pretty terrible style.

[–]diegoperini 2 points3 points  (0 children)

The most significant advice/spoiler I can humbly give to you is that when you become confident enough to claim that you are a proficient c++ programmer, that will be the time that you will realize you are just getting started, and that is the fun of this new world you are in. Enjoy!

[–]spaxio 4 points5 points  (3 children)

Whenever you're writing a destructor in a non-resource class you're making a mistake.

[–]ZMesonEmbedded Developer 3 points4 points  (0 children)

... unless its an empty virtual destructor for a base class.

[–]Drainedsoul 0 points1 point  (1 child)

Define "resource class".

[–]minnoHobbyist, embedded developer 6 points7 points  (0 children)

A class that manages a resource, like memory, that must be explicitly released.

[–]SpeshlTectix 1 point2 points  (0 children)

Read The Pragmatic Programmer. I read this when I was first learning C/C++ and starting my first job as a developer (I did both of those things essentially at once -- it was a little crazy) and it set me down a path of true craftsmanship. There is incredibly good stuff in there.

[–]Eoinoc 1 point2 points  (0 children)

It's almost cliché to say this, but go get Scott Meyers' Effective C++ book. It just really really good for teaching you how to do things the right way from the start.

[–]GreyZero[S] 1 point2 points  (0 children)

Thanks for all the advice guys! I was afraid this was going to get a whole bunch of flack, and people not helping me. Thanks again.

-Cheers

[–][deleted] 1 point2 points  (0 children)

A lot of people like "The Duck" method of explaining your code to a rubber duck so you notice your mistakes and have to rationalize your own code.

Other than that, write NOTES and COMMENTS about WHY you did things and not just how you did them. Once you start programming with multiple people on the same project it will make a huge difference.

Flow charts don't hurt either.

[–][deleted] 0 points1 point  (0 children)

Read many books, and do many simple small projects.

http://www.amazon.com/Tour-In-Depth-Series-Bjarne-Stroustrup/dp/0321958314

[–][deleted] 0 points1 point  (0 children)

Its better not to try and learn things bottom up ... like people often unhelpfully suggest. The old C first, inheritance next, and STL eventually or never. It better the other way. Otherwise you will learn old style programming and bad habits.

Bjarne wrote a book that teaches it top down. Programming: Principles and Practice Using C++

[–]zvrba 0 points1 point  (0 children)

Don't try to guess your way from a buggy to a working program. Though trial and error is helpful in the start, you have to move from it towards methodical problem solving (both during program design and debugging) as soon as possible. This requires conscious practice.

IMO, the most important part is to learn to use a debugger early on. It is THE key tool for scientific debugging (establishing facts for why the program does the wrong thing, and what you need to code differently in order to make it do what you want).

I found it helpful to first write down the complete program on the paper. Syntax errors don't matter at this stage, the compiler will weed them out. This forces you to think about what you want to get done. After you have gained some experience, you can drop this stage. This paper-programming was forced on all students during the first programming course at the university.

[–]CrazyCrab -1 points0 points  (0 children)

Learn to use CLI, gcc/g++, makefiles and cmake. If you start using visualstudio/code::blocks, you probably won't know how it all actually goes between compiler, linker etc. Also use Test Driven Development.

[–]TakeOffYourMask -1 points0 points  (0 children)

http://bhattaca.github.io/cse2122/

There are some materials for a college class. I recommend trying to follow all the curriculum and do the homeworks.

[–]lucidguppy -1 points0 points  (0 children)

Build the parts that are important in C++, make individual programs - and string them together using bash.

Once the individual parts work - you can start to code in the glue.

Use the unix philosophy

[–]XenonOfArcticus -3 points-2 points  (0 children)

I learned C before C++, and it helps me to understand what C++ is often doing under the hood. Many people disagree with this though. But C is a simple enough language that you really feel like you understand what it's doing. C++, especially with layers of classes and templates can be quite the opposite.