Monday, October 22, 2012

Logic for Programming and Comments on C Programming

On two occasions I have handed a copy of The C Programming Language by Kernighan and Ritchie (K&R) to a bright young person.   I had a chance to speak with one of these young people later on and found that he had been stopped in his tracks when he got to Boolean algebra.  He totally ground to a halt when he hit bit-wise operators. 

I wrote a hand-out on the logical operators, AND and OR to help young people who are studying programming.  I have included the bit-wise operators used in C and I have posted this hand-written set of truth tables on the internet.  There are a lot of bright young people who are capable of teaching themselves how to program, but they have to really want to learn how to do it in order to overcome obstacles.

Then again, young people should not have too many obstacles.  The K&R book is brilliant, but it is terse and might not be a good fit for everyone.  C Programming, A Modern Approach by K.N. King has more explanation and might be a better match for some people.  On the other hand, The C Programming Language has a companion book that is a valuable complement:  The C Answer Book: Solutions to the Exercises in 'The C Programming Language' by Tondo and Gimpel.  Scott Gimpel is the creator of FlexeLint, a useful static analysis tool.

Overall, I believe a young person learning to program will benefit from some coaching, especially when learning to program in C. 

Robert

A previous article on C programming is:
"A Fix for K & R Chapter 1", July 2, 2012, Monday

No comments:

Post a Comment

Comments require my approval before they appear. Be patient. It will take a day or two for your comment to appear.