( split from C++ Book recommendations thread and merged with ChaosEngine's response/discussion thread ~ Ken Fitlike )
I'm not really sure you need an entire book about how to use templates.
( split from C++ Book recommendations thread and merged with ChaosEngine's response/discussion thread ~ Ken Fitlike )
I'm not really sure you need an entire book about how to use templates.
>> I'm not really sure you need an entire book about how to use templates.
If you want to use them (and C++) well, then both of those "entire" books would be good choices.
I think that a chapter in a larger good book is fine. Note that I am not talking about the STL, but rather the implementation of the template language feature.
This isn't exactly the place to discuss this, but are you familiar with what is contained in those books? I'm guessing that you are not and that you just don't realize the types of advanced programming techniques that are available through templates. If you consider yourself ready for advanced C++ programming, and you haven't read them already, consider buying or borrowing those books, or even reading through them in a bookstore.
No, I've read (and own) one. I don't happen to think you need an entire book to explain the topic. Some might, and I respect that. I think that you don't. Perosnal opinion, take it or leave it. I feel that a good chapter in a good book, combined with some research online, is sufficient. I felt that my money could have been better spent. That being said, there are those who can only learn through a real book, and if that is true, by all means, buy a book. If not, like me, skip it.
in this post I recommended some books.
manutd disagreed and I think this is an interesting discussion but I don't want to hijack the book thread (which IMHO is a good resource), hence this thread.
First, which book do you own? I'm assuming it's the Vandevoorde/Josuttis Template book since that's what you seem to be focusing on.Originally Posted by manutd
Personally, I think templates are one of the largest and most complex areas of C++ and easily merit their own book (template meta-programming on it's own merits a book!). I'm curious as to exactly how much coding you've done with templates. If it's limited to a few template classes/functions, then yes a book is overkill, but once you get into policy-based design, tmp and all the rules regarding partial specialisation, I've found that book to be a very valuable resource that has some info not available on the web. for instance, do you know off the top of your head the formal ordering rules for template matching? If you do, you're a smarter man than I.
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?
Yes, that's the one. I've done a lot of coding with templates, hence why I own the book. But for the number of times I actually need a reference on the formal ordering rules for template matching, I don't really think its worth the money.
I think it depends on what you want to do with templates
If you want to do what they are intended for then sure a few chapters in a book is enough about how to use templates, make your own templates and make template functions. And hmm, maybe a big chapter on how STL is designed although that needs its own book IMO.
But if you get into heavy template metaprogramming there seems to be no end with what you can do. Then sure, this can fill up a few books easily.
I bought the book of the guy who made the Loki library once, cant remember the name. That book was where I draw the line with what I wanted to know in C++. I really had the feeling in that book that C++ had become an academic toy for people who dont really want to make real programs but just wanna find out what stuff you can do with templates.
But the point still stands, you can do a lot with templates that the designers of C++ never thought of when they added templates to the language. Can fill up lots of books, but you dont need that knowledge to make real C++ programs
As I said, I'm not talking about the STL. That easily requires a book (or two). I feel that a C++ programmer only needs a chapter or two in a larger book, and if any additional features are needed, some research on the internet in order to use templates.
Are you including template meta-programming in that statement?
Yes. Remember, I have the book and have compared the information there to that available online, and I feel the amount of information available only in a book is not worth the money.
I thought you had the Vandevoorde book. I am not familiar with its contents, but the template meta-programming code and examples in Alexandrescu's book could not be covered by a chapter or two. That's what I was referring to.
Manutd, really take the advise already given to heart. Template based techniques are vast, powerful, and not always apparent from someone outside the loop. To think that templates can be fully covered by a chapter or two is to miss the point of template based programming.
Don't forget that C++ templates alone are responsible for an entire new programming paradigm.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Aiih! I have the book. I've read it and don't happen to agree with the neccesity of a whole book, given the information available on the internet.
???
But... then you surely don't agree with any book in C++!
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.