2

I've been doing C++ for 3-4 months in a local college and I'm doing extra reading / learning using Accelerated C++ and so far, I've "finished" it. Now, I'm wondering which book to get next that'll help me code better in C++.

I've looked around and found this: The Definitive C++ Book Guide and List

I'm sorry if this question may seem stupid for most of you here but I'm a bit tight in cash and I would really want to invest in something that's "right" for me at this time.

Right now, I only know the basics of stuff like (classes, templates, STL, iterators, dynamic memory management).

Do you have any suggestions? Should I focus on STL or templates..? Or should I read something like The C++ Programming language?

halfer
  • 19,824
  • 17
  • 99
  • 186
Coding District
  • 11,901
  • 4
  • 26
  • 30
  • Dupe of http://stackoverflow.com/questions/1169977/which-c-book-should-i-read-after-finishing-accelerated-c –  Jul 31 '09 at 08:27
  • It is subtle, but I think this question is asking "what should I do next", not "what should I read next"? – RedBlueThing Jul 31 '09 at 14:13

10 Answers10

5

If you haven't yet read Stroustrup's books, they are definitely a good read. There's nothing quite like reading about the language from the person who designed it.

Whenever I learn a new language, I always try to find the canonical reference material written by the language designer or somebody very close to them.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
  • 2
    I found Stroustrup's book "The C++ Programming Language" unhelpful when I was a college freshman. It was all about "look at the cool tricks you can do with my language!" It was unsystematic and only a so-so reference. – Drew Hoskins Jul 31 '09 at 05:14
  • @Drew. TCPL is not for learning programming. It is for programmers who want to learn C++. – Khaled Alshaya Jul 31 '09 at 14:14
3

In addition to reading Stroustrup's books (suggested by another answer here), I'd suggest his two FAQs as a great starting point:

They both link to further reading material.

These two, along with the C++ FAQ Lite, are required reading for new programmers at my workplace.

Once you're even a bit more comfortable, consider jumping in to the community: subscribe to something like the boost mailinglists, watch the blogs of big name figures like Herb Sutter, read Alexandrescu's Guru of the Week articles. You may feel like you're in over your head (I still do often after many years of reading the lists) but you'll learn a ton, especially watching the language grow and evolve. (And this stuff is free!)

You can get more understanding from watching how a language changes over time, and how people actually use it, than you can from a million hours of memorizing the standard. (Not that shelling out a few bucks to have a copy of the ISO/IEC standard around is a bad idea, mind -- great for reference from time to time.)

As for books:

  • after the Stroustrup books,
  • start with the Meyers ("Effective") books.
  • I'd also recommend C++ Coding Standards -- a great amount of work went into gathering the "common sense" of the users of the language in this book.
  • Then if you want to blow your mind you can look at Modern C++ Design or some of the fun template metaprogramming resources...

Above all, just stay connected and interested. Mailinglists, blogs, websites, academic papers, magazines, whatever -- choose what suits you best, don't expect to follow everything all the time, but keep your ears and eyes open; find aspects that interest you and follow them!

leander
  • 8,527
  • 1
  • 30
  • 43
2

The C++ Programming Language would give you the best overview of the language. It sounds like you have that but the section on object oriented programming is worthwhile. I'd probably spend more time learning about object oriented programming at this point than more specific C++ features.

A book like "Code Complete" might be a good choice for you.

Jon
  • 2,085
  • 2
  • 20
  • 28
  • If I'm not mistaken, Code Complete is for more advanced programmers rather than students like me – Coding District Jul 31 '09 at 02:37
  • 2
    +1. You don't have to read this book sequentially cover-to-cover, but you do need to digest it over time and have it as a reference. – Marsh Ray Jul 31 '09 at 02:39
  • I don't think that it's ever too early to begin working on your form and that book is great for that. – Jon Jul 31 '09 at 02:42
  • 1
    Code Complete was groundbreaking when is was written and is still valuable and practical and a good introduction to certain ideas and mindsets. However, last time I picked it up it seemed to dwell a bit too much for my taste about whitespace and comment formatting conventions for Visual Basic. No way is it too much for 'advanced programmers'. You might be well served by _Writing Secure Code_, also MS Press. – Marsh Ray Jul 31 '09 at 02:44
2

I feel like you can probably make more progress learning to program by tackling real programming problems, rather than reading another book.

I certainly don't discount the value of books as a programming resource but I do think there is no better way to learn a programming language than writing real code. Given your financial constraints, you have the additional motivation that writing code is free.

Concentrating on a particular part of the language or a pattern for programming might be interesting, but a specific problem to solve will give you context that, in my opinion, is a more powerful learning mechanism.

Of course, you can't write code in a vacuum. You have already read Accelerated C++ which will probably give you more than enough to get started writing code, but there are also a whole pile of resources on the net that will help (StackOverflow is a great place to start).

Community
  • 1
  • 1
RedBlueThing
  • 42,006
  • 17
  • 96
  • 122
2

These are my favorite:

Effective C++ - Scott Meyers

C++ Standard Library Tutorial and Reference - Nicolai Josuttis

I might suggest a library card, or hanging out and reading Border's, to make sure the books are helpful for you.

Juan
  • 3,667
  • 3
  • 28
  • 32
1

a Good book for templates - C++ Templates by David Vandevoorde, Nicolai M. Josuttis

KV Prajapati
  • 93,659
  • 19
  • 148
  • 186
  • 2
    That's a fantastic book, but I wouldn't recommend it for someone's second C++ book after just 4 months. – Marsh Ray Jul 31 '09 at 02:37
1
  • Learn STL more and more, there is a lot more to learn.
  • learn Boost. This would change how you think about programming in C++.

If you want to go very deep, read Stroustrup's papers. Select a paper now and then, print it, read it carefully. Stroustrup is an excellent writer. reading his papers would make you a superior C++ programmer for sure.

My favorite list is :

Khaled Alshaya
  • 94,250
  • 39
  • 176
  • 234
0

If you don't want to spend money, you should learn multi-threaded programming. The basics are already in the books you have, and described in API documentation. Try to actively create a program with many threads that communicate back and forth, and then multiply the number of threads to see if you've made a good design.

You'll want to read up on Semaphores, Mutexes, and Critical Sections.

I take three approaches to multi-threaded programming:

  1. Use a PostMessage style communication between threads
  2. Pass thread-safe objects between threads through which data is stored and relayed
  3. Initialize a thread on start-up, let it run on its own, and then retrieve the data at the end of the run

If you're ready to spend money, I would recommend Design Patterns as a good next-read. It's more generic, and you'll find some of the ideas make sense.

Kieveli
  • 10,944
  • 6
  • 56
  • 81
0

I think you started out with just the right book! For those who didn't know, this book starts with STL at the beginning and leaves pointers for the end. Most programmers learn C first, and consequently have a forever distorted view of what C++ can be.

It might be really interesting for you to now read 'The C Programming Lanugage' by Kernigan & Richie at this point. This is probably a necessity if you want to understand the mindset behind most C/C++ code in the world today.

But more important than your next programming book is to find a medium-sized program you really want to write, and go after it. Use all kinds of reference materials for the project. Incorporate a boost library or two in your program.

Marsh Ray
  • 2,827
  • 21
  • 20
0

If you are tight on cash, read How to Think Like a Computer Scientist. Also read the FAQ lite.

jkeys
  • 3,803
  • 11
  • 39
  • 63