Thread: C Primer Plus or C Programming: A Modern Approach?

  1. #1
    Registered User
    Join Date
    Nov 2019
    Posts
    3

    C Primer Plus or C Programming: A Modern Approach?

    One of my sons is looking to learn programming, these two books seem to be the most recommended.

    With your expertise, which one would you recommend for having a solid foundation in C?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,527
    What sort of age range are we talking about here?

    FWIW, C isn't a good first language to learn.

    Start with Python.
    It will teach some good habits, and you can get an awful lot done quite quickly without worrying about a lot of low-level detail.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Nov 2019
    Posts
    3
    Quote Originally Posted by Salem View Post
    What sort of age range are we talking about here?

    FWIW, C isn't a good first language to learn.

    Start with Python.
    It will teach some good habits, and you can get an awful lot done quite quickly without worrying about a lot of low-level detail.
    He's 16 and he actually wants to learn C first

    Just wanting to make sure he has the best resource.

  4. #4
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    650
    Personally I never got a book, I just dove in head 1st with template files and learned by trial & error & reference & occasional tutorial, Just get codeblock downloaded onto his/your pc and get him started with making a calculator, for GUI just use an open source library like IUP and that should be enough for him to learn most of the basic concepts, everything else he'll seek out on his own.

  5. #5
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    677
    @elonmusk

    The two books I recommend are as follows:

    C Programming, A Modern Approach
    Author: K. N. King

    C Primer Plus, 6th Edition
    Stephen Prata

    Either one would do fine. Study every chapter, and do all the exercises at the end of each chapter.

    Please stay away from online tutorials & YouTube videos. They are painfully insufficient, and in some cases wrong. You also can't learn the language simply by trial & error!

    I wish your son well!

  6. #6
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    650
    Quote Originally Posted by rstanley View Post
    Please stay away from online tutorials & YouTube videos. They are painfully insufficient, and in some cases wrong.
    True most of the time but it really depends on what you want the tutorial for, in my case I usually only use them when I'm struggling to understand something from the reference.
    Quote Originally Posted by rstanley View Post
    You also can't learn the language simply by trial & error!
    I'm living proof that you're wrong on that

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    3,687
    Quote Originally Posted by awsdert View Post
    True most of the time but it really depends on what you want the tutorial for, in my case I usually only use them when I'm struggling to understand something from the reference.
    I'm living proof that you're wrong on that
    False, learning any programming language requires reference material.
    Trial & error can help; but, is no substitute for reference material.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,527
    /me checks out elon's apparent "birthday" on the mod page and laughs....

    Why do I get the feeling the person who really wants to learn C is you?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  9. #9
    Registered User
    Join Date
    Nov 2019
    Posts
    3
    Quote Originally Posted by Salem View Post
    /me checks out elon's apparent "birthday" on the mod page and laughs....

    Why do I get the feeling the person who really wants to learn C is you?
    Off to SpaceX and Tesla to change the world

  10. #10
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    650
    Quote Originally Posted by stahta01 View Post
    False, learning any programming language requires reference material.
    Trial & error can help; but, is no substitute for reference material.

    Tim S.
    Quote Originally Posted by awsdert View Post
    Personally I never got a book, I just dove in head 1st with template files and learned by trial & error & reference...
    Enough said :P

  11. #11
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,234
    Quote Originally Posted by elonmusk
    With your expertise, which one would you recommend for having a solid foundation in C?
    I agree with Salem: "C isn't a good first language to learn". It is a good language to learn at some point, hopefully earlier rather than later, because knowing C will help you understand programming better as C tends to be closer to the machine than most other languages that you will commonly encounter while still being a "high level language", but the core of the craft is not so much programming languages themselves than it is things like "computational thinking", and that's better initially served with languages like Python.

    Having said that, if you insist on C, then having perused an online copy of part of "C Programming: A Modern Approach", I can say it seems reasonably good: none of the obvious problems that exist with some of the beginner-friendly-but-bad-content C introductory books out there.

    Quote Originally Posted by awsdert
    Personally I never got a book, I just dove in head 1st with template files and learned by trial & error & reference & occasional tutorial, Just get codeblock downloaded onto his/your pc and get him started with making a calculator, for GUI just use an open source library like IUP and that should be enough for him to learn most of the basic concepts, everything else he'll seek out on his own.
    That's a common way to learn a subsequent programming language, but you're saying that that's the approach you took for your initial programming language? I suspect that you took much longer to plug the gaps in your learning than if you had followed a structured introductory book/tutorial (or class, in which case it would likely be notes/slides). That is, an approach might have worked for you, but that doesn't mean that another approach wouldn't have been better when you don't have prior programming knowledge.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  12. #12
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    650
    Quote Originally Posted by laserlight View Post
    That's a common way to learn a subsequent programming language, but you're saying that that's the approach you took for your initial programming language?
    I don't think I ever said that was my initial programming langauge, I started off with VB6 in college (don't think I ever actually questioned integers and pointers beyond how it is actually represented, was at least 12-14 years ago), I then moved onto javascript on a later module and boy did I love that, felt so liberating in comparison to VB, still don't remember questioning any concepts beyond how to "talk" to the system I was on, probably developed flexible thinking unintentionally at that time, definitely my habit to make portable code whenever I can

  13. #13
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,234
    Quote Originally Posted by awsdert
    I don't think I ever said that was my initial programming langauge
    Ah, I thought it was good to check because elonmusk indicated that he (or his probably imaginary son) wants to learn C as his first programming language, so it sounded like you were speaking from a similiar experience... whereas it turns out that you initially learnt programming in the structured environment of college, so your advice actually comes with that previously unstated caveat.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Programming Approach
    By RyanC in forum General Discussions
    Replies: 4
    Last Post: 05-27-2019, 09:42 PM
  2. Replies: 7
    Last Post: 08-28-2013, 06:08 PM
  3. example from c programming "a modern approach"
    By convenientstore in forum C Programming
    Replies: 8
    Last Post: 06-15-2009, 03:08 AM
  4. programming approach...
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-27-2001, 06:55 PM

Tags for this Thread