

The Rook's Guide to C++ - cordite
http://rooksguide.org/2013/11/26/version-1-0-is-out/

======
bruno2
I have found a mistake: In table 9.1 of chapter 9 "Data types and Conversion"
you wrote that the char data type ranges from -128 to 127, but that's not
true, because the standard doesn't say that a char is signed or unsigned, it
depends on the implementation. A char can be an unsigned char and in that case
it will range from 0 to 255.

~~~
cordite
Thanks, I'll add it to the tracker.

~~~
Someone
A char also isn't guaranteed to be 8 bits. POSIX requires it, but in ISO C++,
a char can be as large as a long long int ([http://www.open-
std.org/jtc1/sc22/wg21/docs/papers/2012/n333...](http://www.open-
std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf), section 3.9.1, paragraph
2)

------
recentdarkness
Well I just skimmed the book but it seems to be incomplete. Even though it is
referring to C++11 it is not talking about language features like: \- lambdas
\- Templates (it's referring to the STL at the end though)

Which since this is a contribution based book is not a bad thing. However this
book still needs quite some work. Writing a C++ book is not easy. From all the
C++ books I know there's less than a handful which are actually not full of
errors and wrong advices.

~~~
yoodenvranx
Which books could you personally recommend? I am still searching for a book
which gives good advice for trickier problems.

~~~
recentdarkness
Well it depends on where you stand.

For beginners a very good book from my experience is C++ Primer by Stanley B.
Lippman, Josée LaJoie, Barbara E. Moo. The 5th edition even goes into the
newer topics like the aforementioned lambdas, also variadic templates. A nice
thing is that it comes with exercises, which in my particular case was how I
learned programming. I found a new feature of the language, or a class new to
me and I played with it until I understood how it works.

Another good book for beginners is Programming -- Principles and Practice
Using C++ by Bjarne Stroustrup, from what I read, he wrote this book with the
background of teaching programming at the university and wanted to write a
good book which uses a good approach which can be used for teaching students
programming in C++.

If you are already further in and not at the beginning of learning C++ there
is a list of books I recommend as further readings:

\- Effective C++ by Scott Meyers

\- More Effective C++ by Scott Meyers

\- Effective STL by Scott Meyers

\---

\- Exceptional C++ by Herb Sutter

\- More Exceptional C++ by Herb Sutter

\- Exceptional C++ Style by Herb Sutter

\---

\- C++ Templates - The Complete Guide by David Vandevoorde and Nicolai M.
Josuttis

\- Modern C++ Design - By Andrei Alexandrescu

\- C++ Coding Standards by Herb Sutter and Andrei Alexandrescu

Last but not least, reading the C++ Standard is the last bit on the topic of
C++

This is the list of books which I recommend anyone who really wants to become
great in C++

HTH :-)

Edit: I should probably mention The C++ Programming Language (4th Edition) by
Bjarne Stroustrup as a must have as well ;)

~~~
shubb
The C++ Standard Library: A Tutorial and Reference

This is a book on STL (updated for C++ 11) is a classic, and actually very
readable. Quite a lot for advanced users, but also not too dry!

[http://www.amazon.co.uk/gp/product/0321623215/ref=pd_lpo_sbs...](http://www.amazon.co.uk/gp/product/0321623215/ref=pd_lpo_sbs_dp_ss_1)

I'd also recommend Zed Shaw's C The Hard Way, because although C++ is not C,
getting good at C helps you understand C++ when it goes wrong.

~~~
recentdarkness
True, The C++ Standard Library is a very good book as well

------
shin_lao
I would have gone with the C++11/14 syntax right away. C++03 is here to die
out, and if you start with C++ there's no reason to learn the old syntax.

e.g. auto keyword, {} initializers, foreach(), lambdas, etc.

~~~
dkersten
Agreed. Anything less than C++11 is, IMHO, obsolete and should not be taught
to beginners anymore. C++11 is also much more pleasant to work in.

~~~
shin_lao
I would even drop the "C++11" reference and just keep refering to it as C++.
Maybe just mention in the forewords that you need a C++11/14 compiler.

~~~
dkersten
I agree with this. I only mentioned "C++11" in my comment so that its clear
what I'm referring to.

------
___1___
Hmmmm. why do you teach arrays before containers? And why is so little if any
time spent on the std:: containers (ctrl + f deque returns nothing).

The word template is mentioned 3 times, and never once on how to write your
own basic templates (no, that's should not be considered advanced).

Finally, why do you keep using the `.open` member function for your streams
rather than specifying the file path in the constructor and then testing the
validity of the whole stream rather than individual flags.

ie:

    
    
        std::ofstream ofs { "my_file" };
        if(ofs) { ///sucess...
    

You also don't even begin to touch on the standard algorithms. Take for
example the book "Accelerated C++". It's only 300 pages, but it has the reader
writing modern code with containers and standard algorithms with in the first
few pages. It's a much better approach in my opinion.

------
616c
Anyone know the background. Is it worth a read compared to more traditional
books, like Stroustrup's book?

~~~
cordite
_I first was a backer and then the main guy behind it asked if any of the
backers had experience with LaTeX. So I volunteered as a technical editor._

The book seems to be written for those that have _some_ but not extensive
programming experience, and have a desire to learn C++ as a real first or
second (not fifth) language.

It is still rough, but it has all the content proposed now put together.

For those that don't know programming, but want to get into it: You might want
to wait a bit, but it should give a gist of what code can be like.

For those that know programming but not C++: this should be a simple book that
you can skim through and start writing (valid) C++ code like a college
freshman.

For those that know C++ well: Skip this, this won't teach you anything new.
You won't learn the internals of how inheritance works at runtime and how
virtual methods are called or anything else cool like that.

Within the next week the repo should be opened up for those that wish to
contribute.

------
ezolotko
C++ is a programming language that is used in modern applications primarily
for low level tasks like hardware interaction/embedded, games etc. This
involves much dedication while learning, and a proper coverage of computer
architecture aspects. This is why I do not see much point in learning C++ in a
"For Rookies" way "in 21 days". If you want to be a C++ programmer, go find a
good introductory C book which properly covers the aspects of memory
management and pointers (like the Deitel's "C How to Program"). Then,
gradually start C++ with something like Shildt, or again the Deitels. Then,
maybe, one day you will want to look at the Stroustrup's book.

Otherwise, learn C# or Java or whatever quacks like a duck.

~~~
abrahamsen
That is really bad advice. C style memory management is useless in the
presence of exceptions, and a nightmare to get right even in C. Choose a book
that teaches RAII from the beginning, and leaves C style memory management to
a late, advanced chapter.

Accelerated C++ used to be that book, don't know if there is a newer and
better replacement.

~~~
ezolotko
I agree that in modern C++ you need to avoid all the bare-C ways. Actually, my
C++ is almost C# if you look at it, especially with the new c++11 standard.

But I still believe that to learn C++ the best way is to start with C, pointer
arithmetic, and classic strings. Otherwise you will just miss the point and
join the hordes of script kiddies who "once started C++".

~~~
eonil
I agree that understanding of pointer is essential to use C++, but the problem
is many learning materials force learners to believe the have to use pointer
everywhere - which is opposite in reality…

So there should be a good guidance of avoiding pointers as much as possible
when learner is stepping to C++ from C.

------
rtkwe
In FF24's built in pdf viewer it's just a massive scramble.

------
GP5Aloy
Holy crap i know a lot more c++ then i thought i did.

~~~
diadara
My exact feelings, I did c++ in high school with some ancient borland c++
compiler. I always felt I don't know enough of c++ whenever I happen to go
through some modern c++ source code. I just realized that is just the STL.

~~~
dkersten
Well, _the STL_ (actually, that term has fallen out of favour , its now _The
C++ Standard Library_ ) is a core part of the language to the extent that I've
often heard it said that if you don't use it, its not really C++ at all. For
example, if you use char* for strings (instead of std::string), then you're
not actually using STL. If you use arrays instead of containers (std::array,
std::vector etc) then its not really C++. Stuff like loops (except I guess the
C++11 foreach loops), conditionals, functions etc is all basically just C. The
_C++_ is more than just adding classes - its also adding templates, new
semantics (eg move semantics, initializers etc) and the Standard Library.

Having said that, you probably DO know more C++ than you realised :-)

