1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Good book on C++?

  1. Jul 22, 2014 #1
    Can anyone advise me a good book on tutorials for C++?
    Something that starts easy and goes to complex?
    Thank you.
  2. jcsd
  3. Jul 22, 2014 #2
    Last edited by a moderator: May 6, 2017
  4. Jul 22, 2014 #3
    Thank you :)
  5. Jul 22, 2014 #4

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Last edited by a moderator: May 6, 2017
  6. Jul 22, 2014 #5
    I would suggest using some free resources first and them buying a book when you need advanced material.

  7. Jul 22, 2014 #6
    Meh the book worked for me :D
  8. Jul 22, 2014 #7

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    The basic problems with any of Schildt's books is that they are full of sloppiness and even out-and-out errors, they are out of date, and worst of all, they teach what are widely regarded elsewhere as bad programming practices.

    Some good introductory books on C++:
    Last edited by a moderator: May 6, 2017
  9. Aug 20, 2014 #8
    This is the book that I learned from:
    Problem Solving with C++ by Walter Savitch

    But I would also recommend visiting http://www.cplusplus.com/
    for some free tutorials
  10. Aug 21, 2014 #9
    Also, I would imagine anything by Bjarne Stroustrup would be good.
  11. Aug 23, 2014 #10


    User Avatar
    Gold Member

    This is what our CS department uses for C++ [0]. It's also since been updated to use C++11 and C++14.

    As a general reference, having a copy of Stroustrup's The C++ Programming Language can't hurt.

    [0] My claim to fame for this thread is that Stroustrup's office is 3 floors above mine, and I've also been in the same elevator as him...
    Last edited by a moderator: May 6, 2017
  12. Aug 25, 2014 #11
  13. Aug 26, 2014 #12


    User Avatar

    Last edited by a moderator: May 6, 2017
  14. Aug 26, 2014 #13
    Can you elaborate on those bad programming practices? I learned C++ as a freshman in college but I've ... 5 years later, begun to realize the whole OOP paradigm makes things a lot harder than they need to be in my cases. Unless you're actually writing an API, it's completely ok and maybe even good to not feel like you need to encapsulate everything in classes, particularly if you're working in small teams with good communication or alone where you don't necessarily need to prevent your code from being "used incorrectly". I came to this conclusions and others with the help of some software engineers' blogs....folks who are actually in the trenches trying to accomplish things effectively and efficiently, not by academics trying to write cool new language features that may or may not be useful.

    That said, I'm not a software engineer or an expert on C/++. The books you recommended may also be full of productivity-based s.w.eng. practices. I simply find it fascinating what the "trade-oriented" side of s.w.eng. is saying, and think it might be useful for someone new to C++ to learn if/when OOP isn't appropriate in some cases.
    Last edited: Aug 26, 2014
  15. Aug 27, 2014 #14

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Schildt is widely reviled by those who do know how to program. The big problem with Schildt is that his writing style makes him widely loved by those who don't know how to program. An even bigger problem: That group unfortunately includes instructors whose job is to teach people to program.

    Schildt apparently has a gift for writing clearly. Unfortunately, what he writes so clearly about oftentimes is clearly wrong. For a while, there were challenges on the internet regarding Schildt's books: Someone would pick book by Schildt and a random number, and then others would find the errors on that page in that book. This got a bit old as it became obvious that almost every page of every one of Schildt's books contained some error. Typos exist somewhere in every book, as do occasional misconceptions by the author of any book. But on every page? No. That shouldn't happen.

    Schildt's newer books have apparently finally removed some of the extremely glaring errors (e.g., void main()) and extremely MSDOS-biased concepts (e.g., #include <conio.h>) that drove so many people so very crazy. Whether he has fixed things enough to cover his sins of the past remains dubious.

    There's nothing in the C++ language that says everything has to be an object. Every working C++ program necessarily has at least one function, main, that is not a member of any class. C++ offers a number of different programming paradigms. You as the developer are responsible for determining which paradigm (or paradigms) best fit the problem at hand. There certainly are places where the object oriented paradigm is at best a sub-optimal choice, and C++ does not force you to make that sub-optimal choice.
  16. Aug 27, 2014 #15
    Well, yes. The language itself doesn't force you to stick to OOP, but culture and best practices I was taught in college were to encapsulate everything. Quite possibly you had a very different experience than I. But from other reading what working programmers have to say, I'm finding my training on dogmatically sticking to OOP and encapsulation-centric programming styles isn't that unique. That's all I was trying to point out to OP. These academic instructors (at least mine did this ) on C++ tend to focus on ideal styles of what code would look like, with less-than-appropriate regard for the the time it takes to actually write code in that style. Anywho..
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted