Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C/++/# C++ Primer vs PPP Stoustrup

  1. May 7, 2017 #1
    Hey everyone,

    I've been looking to get another C++ book. I'm currently using Gaddis Control Structures through Objects (required at my university). However, I find sometimes their explanations are poor or their examples are too long to really illustrate the point they're trying to make (e.g. a near 300 line program to explain polymorphism -- something that could be done in probably 30 lines of code).

    I have I have a semester's worth of C++ under my belt, and a semester's worth of Python under my belt. I've been doing some research on additional books to read, and it seems like Primer or Programming: Principles and Practice Using C++ are the kind of go-to books for beginner programmers. I'm torn. I've heard PPP is more useful if you've never programmed before, while Primer is better if you have. My debate is that I've heard Stoustrup goes into more detail (since he is the creator of C++, which is why I'm leaning towards this book) than Primer -- while Primer teaches better practice on how to actually code (which I'm not sure if this would be more useful for me at this point). I plan on getting both at some point, but what do you recommend for someone in my position with my experience?

    If it matters: both semesters I received an 'A' in the course. In Python I felt more confident in my abilities. Whereas in C++ I felt like even though I earned an 'A', I left the course with more questions than answers since C++ is so massive. In the book we used, we covered basics like functions, classes, arrays, pointers, etc. and then covered some more advanced topics like OOP, polymorphism, inheritance, c-strings, and advanced file i/o topics. This latter topics, while I did well on the test, I felt overwhelmed and lost on all of them. I think my book did good explaining the more elementary topics, but these last few chapters were horrendous. Reading the book actually took the fun out of programming through these chapters, and I often resorted to videos just to get the big picture.

    Anyways, thanks for any advice.
     
  2. jcsd
  3. May 7, 2017 #2
    Stroustrup is a master, not just regarding C++, but about programming principles more generally. Learn from him.
     
  4. May 7, 2017 #3

    jedishrfu

    Staff: Mentor

    Theres also Scott Meyers Effective C++ and the various Design Patterns books too. Design patterns goes beyond the basics and gets into how to use OO effectively while not painting yourself into a design corner with no exit ie poor design that only a complete redesign will fix.

    https://www.amazon.com/Effective-Modern-Specific-Ways-Improve/dp/1491903996
     
    Last edited by a moderator: May 8, 2017
  5. May 7, 2017 #4

    QuantumQuest

    User Avatar
    Gold Member

    The important thing is to assess your real coding capabilities in C++ so far, a thing that - talking according to my own experience in the past, is difficult when you are a student. I would recommend trying to code some intermediate to advanced algorithms yourself with some fairly advanced data structures. What I'm talking about here is things like three way merge sort, quicksort with three way partition just for starters and beyond, to coding complex algorithms in the most efficient way(s)(including proper and efficient use of the necessary data structures) - I'm assuming that you already know the classic merge sort and quicksort very well and again these are just two (not so complex) examples. The reason I recommend this is that it is the suggested way by many well known computer scientists and seasoned programmers - a great such case is Robert Sedgewick recommending it for Java (you can take a look at the free online Algorithms course offered by Princeton University on Coursera) and for very good reason: in order to efficiently code a (fairly) complex algorithm, create a client program to run it and test it for performance you'll find yourself constantly digging through the basic language so you'll grasp things that can't be clear through a simple basic course. This way you'll get a fairly informed picture about what text you need next and the way you must study it. It goes without saying and I'll agree to Dr. Courtney that Bjarne Stroustrup is a real master but what you need heavily depends on where you are right now regarding coding and what is your goal. C++ is a fussy beast to tame and there are relatively few programmers all over the world who are real masters of it, the reason being that this whole software system is really huge and it needs many years of real world experience in order to get acquainted with it. If you find that at some point you really have all the basics under your belt then go with any good advanced text - Stroustrup's books are preferred books for me too.
     
  6. May 7, 2017 #5

    QuantumQuest

    User Avatar
    Gold Member

    This is also a really great recommendation by jedishrfu. I recall the great joy I had in the past to take some online courses in mobile programming by Douglas Schmidt - one of the persons involved in the books of design patterns and it was a tremendous experience and a real call for further reading.
     
    Last edited: May 7, 2017
  7. May 8, 2017 #6

    wle

    User Avatar

    The dissenting opinion: you might want to browse the C++ FQA before deciding how much of your life you want to invest learning C++. (If nothing else it's wonderfully sarcastic -- you won't be bored.)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: C++ Primer vs PPP Stoustrup
Loading...