What C++ book is recommended for trying to program with ROOT

Since I have so many C++ questions, I have tried many different C++ books. All seem to have a different way of writing constructors, defining namespace, etc.

What resource would be consulted to help a ROOT developer with a question?

I can’t afford five books, but can one.

[quote=“hamletmonkey”]Since I have so many C++ questions, I have tried many different C++ books. All seem to have a different way of writing constructors, defining namespace, etc.

What resource would be consulted to help a ROOT developer with a question?

I can’t afford five books, but can one.[/quote]
For a beginner I would recommend the following one:
www2.research.att.com/~bs/programming.html
and maybe just www2.research.att.com/~bs/ (there are FAQs on his site)
and finally
the greatest (in terms of size) book is www.google.com , can answer all your questions
:wink:

For experts, the main source of information is the standard, I think:
open-std.org/jtc1/sc22/wg21/

in general I would also recommend writings from Herb Sutter, Scott Meyers and Andrei Alexandrescu
All the books of them I saw were extremely useful.

… then you should get the definitive C++ book: www2.research.att.com/~bs/3rd.html It has been translated into a number of languages, so if english is not your first/primary, you may have better luck with your native tongue. This book gets better on every subsequent reading, and apart from the standard itself (which doesn’t get better the more you read it :slight_smile: ), is the definitive reference for the language. If you program in C++ extensively, you will eventually own this book anyway.

If you can actually afford 2 books, and are very new to programming, you should consider picking up acceleratedcpp.com/ . It will introduce you to the language in a more “natural”, high level way than most books. It is, however, a teaching text, not a reference. You probably don’t want it as your only text. And no, you can’t skip the homework and expect to learn anything :slight_smile:

[quote]… then you should get the definitive C++ book: www2.research.att.com/~bs/3rd.html It has been translated into a number of languages, so if english is not your first/primary, you may have better luck with your native tongue. This book gets better on every subsequent reading, and apart from the standard itself (which doesn’t get better the more you read it :slight_smile: ), is the definitive reference for the language. If you program in C++ extensively, you will eventually own this book anyway.
[/quote]

IMHO This book is not really good, but it’s still better than other books on C++ :slight_smile:

[quote]Since I have so many C++ questions, I have tried many different C++ books. All seem to have a different way of writing constructors, defining namespace, etc.

What resource would be consulted to help a ROOT developer with a question?

I can’t afford five books, but can one.[/quote]

… I decided to modify my answer …

For styding C++ I would recommend one of Bjarne’s nice books:

  1. www2.research.att.com/~bs/programming.html (Anar already mentioned)

Good for complete beginner, but IMHO it requires a lot of work from you - I guess, it’s written in a way how Bjarne teaches his students. So, you have to work as a student, read it carefully, regularly, step by step, do excercises etc - if you start skipping simple things you know already, you can skip something important - the book is huge.

  1. www2.research.att.com/~bs/3rd.html

I think this book is intermediate step between the C++ textbook and C++ standard. So, if you are not able to find any answer here, you can find it in C++ standard text.

I think, Bjarne’s books are arguably the best texbooks - at least Bjarne can not give you a bad advice about C++ (except typos, errors etc. :slight_smile:) Sure, this is only IMHO, I know a real C++ expert, who thinks, there are no good books on C++ at all.

There are a lot of other popular books on C++.
Books by Scott Meyers and Herb Sutter are mainly discussing
traps and subtle areas of C++, they are good, but they are not a textbooks on C++, they can be only a complement to a good textbook on C++.
AFAIK most of Sutter’s books are available online, as GOTW (Guru of the week) small q/a’s: gotw.ca/gotw/

Books:

amazon.com/Effective-Specifi … 466&sr=8-6

amazon.com/Exceptional-Engin … 556&sr=8-2

amazon.com/More-Exceptional- … 556&sr=8-4

There is a good book on C++ templates by N. Josuttis and D. Vandevoorde
(if one day you want to better understand templates):
amazon.com/Templates-Complet … 025&sr=8-4

There is a good book on C++ standard library by N. Josuttis.

amazon.com/Standard-Library- … 025&sr=8-2

Etc.etc. - just go to accu.org and select “book reviews”. That place is definitely better to select C++ book, than ROOT’s forum:

accu.org/index.php?module=bookre … unc=search

Search books on C++ and read reviews, which has “Highly recommended” mark.

And sooner or later it’s good to look at C++ standard - not a big pleasure to read, but has answers to all your C++ questions (though reading can easily produce more questions without answers :slight_smile:)). You can download draft for free.

open-std.org/jtc1/sc22/wg21/

For ROOT - read ROOT user’s guide.

And yes, if you have a question and you cannot find answer - the best way is to register at some C++ forum and ask people. Just find a good place - where answers will be most probably correct: comp.lang.c++ or comp.lang.c++.moderated. Btw, they must have good FAQ - something like this (?)
parashift.com/c+±faq-lite/

Good luck!

Everyone;
Thank you for the suggestions.
I’m now waiting for Koenig and Moo to be returned to the library so I can peruse it.
At least with it, when checking the index, I’d be doing a “Koenig look up”!

Again, thanks for the suggestions.