tags:

views:

1075

answers:

14

Just would like some thoughts of what you think about my strategy to learn C++. While I understand that it takes years to master a programming language, I simply want to get to the point where I can be considered competent as quickly as possible. Why quickly? Well when I say quickly I'm really saying I'm committed, and that I don't want it to take forever where forever is never. If it takes five years to become competent, it takes five years. I'm not expecting 24 hours or 30 days.

About me: I don't have a CS degree, I have an anthropology degree and a Masters in library science. Learning the CS fundamentals such as Big O notation, and basics such as binary trees and linked lists, sort algorithms has been a challenge. Probably nothing substitutes a good CS degree. :( I do have many years programming experience, starting with PHP in 2001, ActionScript, 2003, JavaScript soon after. I have been writing programs in Python for about two years now and I have learned C (by reading the K&R book and writing some programs), but I'm probably not going to get hired for a C job. Also recently learned Objective C. I work as a JavaScript & Python, & CSS developer at a website at the moment.

Anyhow, this is my strategy: Read the Stroustrup book (I just started on Part I) and at the same time start a simple C++ project, while also doing many of the Stroustrup exercises.

Thoughts?

+1  A: 

Sounds good to me. Get to it!

Scott Langham
+4  A: 

One of the critical things to really become better is to others have a look at your code. When others say 'WTF' to your code, you can improve it and learn from your mistakes.

Try to use code analysis tools, try to use C++ conventions (for example google's http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml), try to use valgrind for memory leak detection. Learn how to write Make scripts manually, try some cross platform compilations to see what parts are tricky.

You might also want to take a look at some popular libraries such as boost.

As of the project, make it opensource so people can look at it and give you suggestions. To really incorporate your lack of CS education, grab a scientific paper and try to implement it using c++. Check the results and compare them.

Tomh
+1  A: 

Sounds like you're on the right track;

1) Set yourself mini-projects of ever increasing difficulty (Hello World, Lottery Picker, Etc Etc)

2) Find a good book or two that contain exercises and can be used as a reference.

It's been about 15 years since I read it, but I seem to recall that the Stroustrup book wasn't exactly the friendliest of the "how to learn..." C++ books. You may want to spend some time on Amazon and do some comparisons.

Andrew Grant
+12  A: 

Bjarne's book is fantastic, especially for C++ syntax, but the one book that will really make you a competent C++ programmer is Meyers' Effective C++. Get it. Read it.

I as well do not have a C++ degree, but I work for a silicon valley startup. It is possible, you just have to be aware of what's out there and never stop learning. Many students who graduate with a computer science degree end up working in a language they didn't study, so be sure to hit the fundamentals. If you hear something that's unfamiliar to you, be sure to find a good book and a coffee shop and get to it. The C++ will come in time - with Stroustrup and Meyers, you've got 90% of what it takes to be good at C++

Matt
+1  A: 

Quite frankly, if you've done a good job of learning C, and you've done object oriented programming (since you've learned objective C), you don't need to overthink your approach to learning C++.

That said, your plan is good.

Rob Lachlan
+1  A: 

If you have a strong handle on C, then C++ is not a huge leap once you have a good handle on the OOP concepts....which hopefully you have from becoming proficient in Python. Coming from C, the biggest thing to learn in C++ is really getting familiar with the Standard Template Library (STL) and all the subtle things come along with using it.

Personally, I think the Stroustrup book is not all that great for learning the language, it's more of a reference. I would recommend C++ Primer Plus as a better book and the Effective C++ books by Meyers for really learning to use the language coherently.

Tall Jeff
+11  A: 

My usual advice is to keep C and C++ separate. Don't assume that C advice or best practices apply to C++, and vice versa. Keeping that in mind will probably help you avoid a lot of bad habits.

jalf
that's why you should always refer to them as "C and C++", not "C/C++", especially on resumes. If you're just referring to languages with a C-like syntax, the name is generally "algol-like languages".
rmeador
+1  A: 

Seems like you're doing it right.

Paul Nathan
+1  A: 

Also be sure to check out How Not to Program in C++

Dana Robinson
+1  A: 

There are dozens of Learning Styles. You've picked one that you think will work for you.

Do you have a specific question or problem? For instance, was your question really a plea for additional or different books? Without you asking something more specific than "Thoughts?", you might not get many responses that actually fit what you're actually looking for.

Programs, BTW, are goal directed. Your learning to also be goal directed. Your questions, similarly must be goal directed. Programming is about tangible, concrete specifics.

S.Lott
+2  A: 

I don't htink the Stroustrop book is a good place to start. It's more of an advanced/reference book. I would start with Thinking in C++ (Volume 1) (and Volume 2. And write lots of code. Once you've got a basic handle on the code I would get the Scott Meyer Effective C++ books and definitely the Stroustrop book.

cletus
I was thinking as you did, but in fact Stroustrup has a new book that I haven't seen, for beginners.
ChrisW
Thinking in C++ is even worse for beginners than TCPPPL
Nemanja Trifunovic
+1  A: 

If you're on this Stroustrup book:

The C++ Programming Language
http://www.research.att.com/~bs/3rd.html

And finding it hard going... which it can be. You might want to switch and start with this one instead:

Programming -- Principles and Practice Using C++
http://www.research.att.com/~bs/programming.html

Scott Langham
+2  A: 

Here is the reading/learning list I suggest

  • First read Thinking in C++ first edition (get the syntax straight)
  • Read Scott Meyer's book Effective C++ (get the finer nuances)

After which you can branch out to the following. You can skip all except maybe 1st. You may use boost, STL, whatever to learn these 1 Learn to use strings & other containers (know when to use which container) 2 Assuming you already know XML, learn to use XML from C++ (Write a WBXML to XML translator maybe) 3 Review your TCP/IP fundamentals, (write simple XMPP based chat client maybe) 4 You may wish to learn some GUI toolkit GTK+, Qt, MFC, whatever

At this time you may want to branch out into reading about design patterns. I recommend 'Design Patterns Explained'.

Once you've spent over an year working with C++ you may want to read, among others, "Inside the C++ Object Model".

Also, I don't recommend that you read Stroustrup but YMMV.

HTH

Holysmoke
+1  A: 

Learn Qt. Trust me on this; I develop all kinds of C++ app for a living. C++ with Qt makes you infinitely more productive. I used to combine so many different libraries (Boost, Intel's, database connectors, etc..) just to achieve the kind of stuff we do (high-performance/real-time computing). At the end, I found that more than 80% of what I need is already included in Qt.

Not to mention, imo, Qt has the best documentation on any framework/library I've worked on, which makes it very easy to just learn everything on your own.

Try it, and see for yourself.

Disclaimer: I'm just a developer--I dont work for Nokia. =p

ShaChris23