Buy A Book Or Not?

Hi all, I'm new to C++ & am a humble enthusiast. I have a vision of a programme which I want to achieve in C++ & some minor experience in VBA.

I've been working my way through Youtube tutorials which are very helpful, but naturally some lessons are not absorbed properly. e.g. I just spent 2 days learning classes & constructors. I thought I absorbed the topic. So I set myself a quick challenge to code a class & I just failed. Would a book be a good purchase? I am torn between 2 books atm, which I'd be grateful if anyone would advise one over the other:

1 - The C++ Programming Language: The C++ Programm Lang_p4 by Bjarne Stroustrup (the architect of the C++ language); 1,376 pages.

2 - Programming Principles & Practice Using C++ by Bjarne Stroustrup (the architect of the C++ language); 1,282 pages.

I have around 1 hour an evening & around 30mins of lunch each day. Possibly 4-6 hours per weekend. The topic has me completely consumed, but is a book a good investment; in my experience not much is retained through books but it's a good reference.
Last edited on
How do you learn best? The web has everything you need to know for free, with examples, but its not at all organized. A book is organized, but it costs (often a fair bit) money. And you can search the web faster than you can search a book.

Regardless, the first thing is to decide if a book is the kind of learning you want, or the kind of reference you want. If it is, then yes, buy a book. I can't advise between those two. 1 is more of a language reference and 2 is more of a how-to.

Also, consider posting your attempt here to get at little help with it.
If your just going to use it as a reference, then why are you buying a book? You could probably find several competent free books online.
Thanks guys, I don't think it will be worth it to be honest. I do not learn from books to be honest.
Yes the scattered knowledge on the web is annoying, but I've found I need to read several articles to absorb it, & try different attempts several times over several days.
Buy A Book

More like "buy BOOKS."

https://isocpp.org/wiki/faq/how-to-learn-cpp#buy-several-books

I scour the internet for tutorials and code examples when I want to learn and relearn some particular aspect of C++ and Win32 API. I also own several dozen books on various programming subjects.

I had more books at one time, but I have winnowed my collection down to the ones I found very useful and want to retain as reference material for another time.

The ultimate IMO online reference site is, of course, cppreference. Good for both C & C++.

https://en.cppreference.com/w/

It is not a tutorial site for beginners, but it has examples from the cutting edge of C++ for the most part. C++2a is, naturally, a bit lean.

For beginners wanting online material there is the tutorial here a CPlusCPlus, sadly a bit dated, and Learn C++. Learn C++ is updated frequently.

https://www.learncpp.com/
I would recommend books. They explain things much more in detail than tutorials or YouTube videos.
I found these 2 are the most useful:
The C++ Programming Language: Bjarne Stroustrup
The C++ Standard Library 2.end Nicolai Josuttis

Once you have finished these then
Clean C++: Sustainable Software Development Patterns and Best Practices with C++ 17 by Stefan Roth
I'm pro books.

The good thing about a book is that it will give you consistent view point. So if you can afford it I would make the investment.

While there is plenty to learn from the web it can be a bit haphazard. And having a consistent starting point from reading a good book will allow you to distinguish the good from the bad when wandering about the Internet.

Of the two Stroustrup books you mention, I would go for the second -- Programming Principles & Practice Using C++ -- as it is an introductory text.

If you carry on with C++ for long enough you should read The C++ Programming Language at some point, but I found it a bit dense until I had gotten the basics down pat.

And you mention you don't retain much from books. Does that mean you're just reading them rather than working through them?

When it comes to text books you should read the chapter once though to get the lay of the land, then go back and read it section by section carefully doing all the exercises as you go. And if you found an exercise hard you should make a note to go back and repeat it at a later date.

This should improve your retention, I would hope!

Andy
Last edited on
https://www.learncpp.com/

^ The only thing I needed to learn C++ as my first language. You can go through the index and learn about classes. It'll give you a problem to code as well.
closed account (z05DSL3A)
I'm a book person. I find online tutorials to be a bit 'golden path', they are useful to get you started but are often lacking in detail... that's usually where I go looking for a good book.

There are a few books, for reference and deep dive, that are never too far away:

The C++ Programming Language by Bjarne Stroustrup

The C++ Standard Library: A Tutorial and Reference by Nicolai M. Josuttis

C++ Templates: The Complete Guide by Nicolai M. Josuttis et al

Introduction to Algorithms by Thomas H. Cormen , Charles E. Leiserson , et al. [not C++ but worth having around]
You don't need a book, but rather the contents of a book, that is only the book "headlines".

May seem like some joke but it's not...

Make yourself headlines ordered from easy to hard just like in books, ie.
1. variables and types of variables
2. data types and properties
3. functions
4. operators
5. loops
...
28. classes
29. unions
30. STL
...


Now as others have said, you have everything on internet, and that's true, thanks to "contents" you make you know what to look for and in what order.

You need 3 kinds of online resources:
1. tutorials
2. code samples
3. references


There are few good tutorial sites
1. http://www.cplusplus.com/doc/tutorial/
2. https://isocpp.org/get-started
3. https://www.w3schools.com/cpp/
4. https://www.learncpp.com/

2 good references are:
1. http://www.cplusplus.com/reference/
2. https://en.cppreference.com/w/

And there are many code samples (you only have type right search string into google)
1. google: "github c++ samples"
2. google: "github microsoft c++ samples"
3. google: "c++ basics samples"

How to approach all this in an efficient and easy way?

1. make your list of headlines (ex. by copy pasting them from tutorial sites)
2. Choose your "headline" from the beginning.
3. Start wit tutorials to see how it's done and practice
4. Next use samples and reproduce them in your own test projects
samples are good way to see how it should be done, samples are more advanced than tutorials, so use them once you complete tutorial.
5. reference is there to learn the details if you're interested, or if you want specific answers, but don't try to learn from references! references are just a lookup tool.
6. once you feel comfortable move to next "headline"

Best way to learn:
Start working on some project in addition to raw learning, that is in line with your knowledge, and keep improving it,
this is good because you'll have something to work on, just completing tutorials and writing test projects to test yourself is waka waka. (not enough and easy to forget what you learn)

I hope this helps a little ;)
Last edited on
Topic archived. No new replies allowed.