Sign in to follow this  
ravengangrel

C++ books recommendations

Recommended Posts

I have a good grasp of most C++ features, but there are two areas about which I know little and I feel I should work. One is the standard library. I know how to use the std types (string, vector, list, map, etc), and I have some understanding of how algorithms work (passing functions to do the comparisons for a sort, or to uppercase a char). So I would say I know enough of it. But I don't know how to use it well. I have seen asnwers here in gamedev with one-liners which do what I would have written in perhaps 25 or 50 lines, and I say: WOW. I have a PDF named "The C++ Standard Library: A tutorial and reference", edited by Addislon-Wesley. Someone has read it? Is good? Should I consider anything about it before reading? Besides, can someone recommend another good book? My other flawed area is templates. I know the basics - how to define a template function, perhaps a template class in a good day, but that's all. Again, one I saw a meta-programming sample which calculated a sin table in compile time, and I said, again: WOW. Any good book on templates (from basic to expert)? Not just the syntax, but also how to use them (I guess the syntax is quite easy if I really decide to go for it). Would it be useful to learn some functional programming language like Lisp?

Share this post


Link to post
Share on other sites
Quote:
Original post by ravengangrel
One is the standard library.

Effective STL: 50 Specific Ways to Improve the Use of the Standard Template Library by Scott Meyers

Quote:
Original post by ravengangrel
My other flawed area is templates.

C++ Templates: The Complete Guide by Josuttis and Vandevoorde

Share this post


Link to post
Share on other sites
Quote:
Original post by ravengangrel
Would it be useful to learn some functional programming language like Lisp?

Always, yes. My suggestion would be Haskell. If not Haskell, then OCaML. If not OCaML, then Scheme. Common Lisp isn't a great language for learning the important aspects of functional programming.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
My suggestion would be Haskell.

Haskell is awesome, you can express ideas very tersely (is that a word?), for example appending one list to another or reversing a list or your own implementation of map:

myAppend = flip (foldr (:))
myReverse = foldl (flip (:)) []
myMap fun = foldr ((:) . fun) []

Share this post


Link to post
Share on other sites
Quote:
Original post by ravengangrel
I have a PDF named "The C++ Standard Library: A tutorial and reference", edited by Addislon-Wesley. Someone has read it? Is good? Should I consider anything about it before reading?


I've read the actual book, which y'know, you should actually buy. It is a very good book for the subject.

Quote:

Besides, can someone recommend another good book?


No, that's pretty much the only book I can recommend for c++.

Quote:

Any good book on templates (from basic to expert)? Not just the syntax, but also how to use them (I guess the syntax is quite easy if I really decide to go for it).


Probably. There's a meta-programming book by Alexandrescu which I've heard is top notch. He's probably got a few books by now actually.

Quote:

Would it be useful to learn some functional programming language like Lisp?


Sure, and I agree with Sneftel's recommendations.

Quote:

Haskell is awesome, you can express ideas very tersely (is that a word?)


Bleh. Terseness of code is not positive.

Haskell is awesome because its expressive. That the functional programming culture almost always takes that to 'how much can I do in the least characters, maintainability be damned?' is a failing.

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
Quote:

Haskell is awesome, you can express ideas very tersely (is that a word?)


Bleh. Terseness of code is not positive.

Haskell is awesome because its expressive. That the functional programming culture almost always takes that to 'how much can I do in the least characters, maintainability be damned?' is a failing.

Much like Perl, no? [grin] Except I think Perl was designed with terseness in mind, not practicality.

Share this post


Link to post
Share on other sites
Quote:
Original post by DevFred
Haskell is awesome, you can express ideas very tersely (is that a word?)

One should always distinguish between terseness and succinctness. Haskell supports both. The first is fun, but should be limited to one's personal exploration and code-play, because it decreases readability. The second is less interesting, but has a place in production code, because it increases readability.

Share this post


Link to post
Share on other sites
Quote:
Original post by ravengangrel
Thanks. I'm getting started already.

fac 0 = 1
fac n = n * fac (n-1)
main = print (fac 42)

Awesome syntax!

Now make it tail recursive. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
I've read the actual book, which y'know, you should actually buy. It is a very good book for the subject.

Thanks, I'll search for it. 600 pages are too much for reading on screen.

Quote:
Probably. There's a meta-programming book by Alexandrescu which I've heard is top notch. He's probably got a few books by now actually.

I'll look for it, too.

Alas, I have made a quick search and it seems that none of the books recommended until now seems easy to find in Spain (don't care much if it's in english) :-(

Share this post


Link to post
Share on other sites
Quote:
Original post by ravengangrel
Quote:
Original post by Telastyn
I've read the actual book, which y'know, you should actually buy. It is a very good book for the subject.

Thanks, I'll search for it. 600 pages are too much for reading on screen.

Quote:
Probably. There's a meta-programming book by Alexandrescu which I've heard is top notch. He's probably got a few books by now actually.

I'll look for it, too.

Alas, I have made a quick search and it seems that none of the books recommended until now seems easy to find in Spain (don't care much if it's in english) :-(


Amazon carries both and you should be able to order them from Amazon.co.uk.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this