Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

learning c++ from boost library source code

Tags:

c++

boost

I am very interested in c++ and want to master this language. I have read a lot of books about c++. I want to read some library source code to improve my skill, but when I read the boost library source code, I find it is very difficulty.
Can anyone give me some advice about how to read boost source code and before I can understand it what kind of books about c++ should I read?

like image 232
cppguy Avatar asked Jun 11 '09 03:06

cppguy


2 Answers

If you're starting out in C++, the boost source code is probably not the best place. It's where the wizards hang out and they deal in template magic. I think a better starting point are Scott Myers and Herb Sutters books (in that order).

Some versions of Scott's book can be a bit out dated but they are still strong in the fundamentals. Herb's books are worth reading many many times and are an invaluable tool. Once you've gotten through both of those authors, then would be a good time to tackle the boost source code.

  • Scott Myers: Effective C++
  • Scott Myers: Effective STL
  • Herb Sutter - Really I would go for anything with Effective and C++ in the title from this list.
like image 186
JaredPar Avatar answered Oct 01 '22 00:10

JaredPar


I can't give advice on how to read boost code, but I can offer some other advice.

Stop reading and start writing :) Reading is valuable, but you won't learn anywhere near as much unless you start writing code yourself. Start with the basics. Read the beginners books and type out the samples (don't copy and paste). You'll learn by having to fix the errors that are the result of you mistyping. Play with some of your own ideas for simple applications and go from there.

Starting off by reading boost source code is a sure fire way of scaring yourself off the language and/or ending up very confused with a lot of questions.

Start small, work your way up.

like image 22
OJ. Avatar answered Oct 01 '22 01:10

OJ.