Suggestion for template book for C++? [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am learning templates. Which book is worth buying for doing template programming?
I already have The C++ Programming Language and Effective C++.

Those two books are pretty good in my opinion and they helped me a lot
C++ Templates: The Complete Guide by David Vandevoorde and Nicolai M.
Josuttis
Modern C++ Design by Andrei Alexandrescu
The first one explains how templates work. The second book is more about how to use them. I recommend you to read the first book before starting with Modern C++ Design because that's heavy stuff.

Maybe a bit mind-boggling if you are just learning, but after the books you mention, you may want to read Andrei Alexandrescu's Modern C++ Design, if only to learn what can be accomplished through templates. Besides, it discusses many advanced aspects of templates wonderfully.

Search for fairly recent book "Advanced C++ Metaprogramming" by Davide Di Gennaro

Both Modern C++ design and C++ Template Metaprogramming are very good (and quite advanced) books on the subject. I have a strong personal preference for the first.

C++ Templates: The Complete Guide is your best bet. You could also learn about the Standard Library which heavily uses templates.

There is a hidden treasure in C++ templates that very few people are aware of: C++ Common Knowledge: Essential Intermediate Programming.
The last 15 chapters of that book both teaches better and complements C++ Template Metaprogramming in some respects. I strongly recommend anyone who is to learn templates to read this book foremost.

"C++ Templates: The Complete Guide (Vandevoorde & Josuttis)" is excellent for the theory.
Then you can learn even more about actual templating practice by looking at how templates are used in the Boost library.

Effective STL by Scott Meyers

Related

What's the preferred sequence to read Effective, More Effective & Effective Modern C++ (and STL)? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I understand that More Effective C++ is an expansion of Effective C++, while Effective Modern C++ focuses on C++11 & 14. Being a newbie to the language and just starting out with these books, should I read Effective Modern after the first two? Also, where should Effective STL fit in?
What is the preferred sequence to reading the above books, in the sense that each book is building on the content of the prior books? (Assuming everything inside is new to me?)
Additionally, is Effective Modern C++ considered an unofficial next edition to Effective C++?
An answer to this can be gleaned from the Books, etc. summary page on Scott Meyers' website:
Effective C++, Third Edition, 2005. Scott's flagship book, and the
industry's must-read second book on C++ (i.e., what you read after
you've learned the fundamentals of the language)
Read this first.
More Effective C++, 1996. Still relevant after nearly 20 years!
Indispensable in its own right, and an invaluable companion to
Effective C++
Read this together with, or after, Effective C++.
Effective Modern C++, 2014. The book on effective use of the features
new in “modern” C++ (i.e., C++11 and C++14). A complement to Scott’s
existing books
Read this once you have mastered the concepts in the other two, as it is focused on the changes in the later versions of the language.
Effective STL, 2001. 50 specific ways to improve your use of the STL,
including techniques for improving performance, eliminating resource
leaks, avoiding portability problems, and more — all in Scott's
inimitable style
This one is less clear although I would suggest reading it after the first two and before the third.

Tips about designing containers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Every time when I'm designing new data structures in C++, I have some troubles with pointers, references, constness, etc. Can somebody please recommend me good books with good tips about designing containers?
P.S book of John Meyers, is that good choice?
There is a detailed description of how the STL is implemented in "The C++ Standard Library: A Tutorial and Reference" by Nicolai M. Josuttis.
Meyer's Effective STL is less comprehensive but does have a section on containers.
Scott Meyers' Effective C++ is a pretty good resource for general C++ wizardry and it does have a great discussion of class design, but I honestly think that his "More Effective C++" is a bit more appropriate to what you're talking about. It talks a lot about class design concepts like reference counting, copy-on-write, etc. It might be a bit advanced for what you're looking for, but it's perhaps the best intro to advanced class design out there.
I also think that Herb Sutter's "Exceptional C++" might be good. I know that it has a pretty good discussion about designing the string class, and that single example is so useful that I would recommend it above everything else. That discussion is also available online, if you find that useful.
Both of those discussions are more about the mechanics of designing a good abstraction around a data structure, but they don't talk much about data structures in general. There are a lot of fascinating data structures out there, and it's probably a good idea to see some of them in action before trying to implement your own. I'm personally of the school of thought that you can learn a lot about class design by taking known data structures and coding them up, though I concede that this might not be the optimal way of learning how to code. If you're interested in seeing some fun data structures (like the binary heap, red-black tree, binomial heap, B tree, disjoint-set forest, and Fibonacci heap), consider picking up a copy of "Introduction to Algorithms, 3rd Edition" by Cormen, Leisserson, Rivest, and Stein. It's widely considered one of the best texts on algorithms, and has enough pseudocode that if you wanted to write up a good data structure, you could almost certainly find enough hints here. These structures, combined with the above books, should have all sorts of info. It's a lot of reading, granted, but you'll be well on your way toward data structure guruship if you can make it through them.
Hope this helps!

What C++ book talks about recommended ways of organizing big projects? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I would like to know about books that talk about design issues like when to use namespaces and other coding standards to write good quality efficient C++ code. One that talks about Code testing will also be appreciated.
"Large-Scale C++ Software Design" by John Lakos worked great for me years ago on how to organise code in large projects.
On testing, this is not my area, and I cannot recommend a great book. What I can do is discourage you from getting "Testing Computer Software", 2nd edition by Cem Kaner, Jack Falk and Hung Q. Nguyen. I found it severely dated and extremely clumsy. But please take this with a grain of salt.
For big projects, it is essential to follow a common design and coding style. Consistently.
I found the following book useful to have a common ground in a big project.
C++ Coding Standards: 101 Rules, Guidelines, and Best Practices by Andrei Alexandrescu, Herb Sutter
book about refactoring: http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672

What is the definitive link for C and C++ programming languages? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Lately all modern programming languages have a definitive web site to support, distribute, learn the programming language, as well as community forums, e-mail lists and so on. Java has java.sun.com, python has python.org, etc.
However C/C++ does not seem to have such a site. Which site do you use, say in a document, to link for C or C++ programming language? Wikipedia entries don't count, although they might be perfect fit.
Founder's web sites? Or any other ideas?
The C Programming Language
Bjarne Stroustrup keeps a lot of interesting links on his homepage. The FAQ and C++ glossary are good references, but make sure you also check out Did you really say that? for an interesting read.
The definitive reference for C++ is ISO/IEC 14882:2011. This is the International Standard defining the language, the library and the semantics thereof. It's also probably far more than you need, and it costs $330 USD. You can get free draft versions of the standard at the committee website (and elsewhere).
C is likewise defined by the International Standard ISO/IEC 9899:2011. As with C++, draft versions available from the committee website.
These languages have been around longer than the Internet as we know it. A lot of the introductory texts are in dead-tree format. Most of the online stuff is reference material, but there are newsgroups and such (I don't follow any of them).
The C Programming Language
Any reference for the C or C++ standard libraries.
C++ Specific:
C++ FAQ Lite
Boost
For C++ there is cplusplus.com and SGI's STL page are good references. But they aren't much help learning the language itself.
How about the Usenet:
comp.lang.c++.moderated (for discussion about C++ Programming, moderated)
comp.lang.c++ (for discussion about C++ Programming)
URL for the two above
comp.std.c++ (for discussion about the Standard)
URL for the one above
I guess people probably won't be needing a definitive website if they have the bible :-)
Some C resources:
C99 specification TC3 (pdf)
comp.lang.c (Google Groups)
comp.lang.c.moderated (Google Groups)
GNU libc manual
GNU libc mailing lists
Lots of good links for both C and C++ covering websites and books, but one that's been overlooked is my favorite for C:
Harbison and Steele
There's always Boost.
Boost provides free peer-reviewed portable C++ source libraries.
Zed the Sharkjumper's textbook: http://c.learncodethehardway.org/

Learning C++ Templates [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Can anyone recommend any good resources for learning C++ Templates?
Many thanks.
I've found cplusplus.com to be helpful on numerous occasions. Looks like they've got a pretty good intro to templates.
If its an actual book you're looking for, Effective C++ is a classic with a great section on templates.
I recomned that you get C++ Templates - The Complete Guide it's an excellent resource and reference.
This is a more advanced, but very useful, book on templates and template use.
Modern C++ Design
Bruce Eckel's Thinking in C++ is how I learned about templates. The first volume has an introductory chapter and the second volume has an in-depth chapter on templates.
There's Bjarne Stroustrop's The C++ Programming Language which has a good chapter on them. And The C++ Standard Library: A Tutorial and Reference which is about the standard library, but would definitely help you get a better understanding of how templates could be used in the real world. .
Be sure to differentiate between generic programming and template metaprogramming (which is more like another paradigm)
Generic programming can be learnt from the C++ bible, but you can just as well take a look at the java generics etc...
one about metaprogramming: Josuttis' book C++ Templates: The Complete Guide
The 2 volumes of 'Thinking in C++' go over the basics of templates. They can either be bought in print, or downloaded for free (and legal) use here.
"The C++ Programming language" by Bjarne Stroustrop