Sunday, July 8, 2012

Definition of a Serious Programmer

Here is a definition from to C:  A Reference Manual, 2nd Edition, by Samuel P. Harbison and Guy L. Steele, Jr., Prentice-Hall, 1987, page xi (Preface):

“… serious programmers are more concerned with correctness and reliability than with programming speed.  Their programs are meant to last a generation, not a weekend.  Their programming emphasizes clarity, maintainability, and portability rather than clever tricks and the fewest number of source program lines.”

If you think about the high standards for reliable operation that were once expected of the American telephone system, then you can understand this definition.  The circumstances today are different.  I believe almost every company developing commercial software expects to ship products than have some bugs in the software.  Your bank ATMs work very reliably, but that cannot be expected from most new software products.  Shipping on schedule is the paramount concern and corners get cut to make schedule.

A lot of companies today do not last a generation, and neither do their products, so why develop software that stands the test of time better than the company creating the software?  Still, Harbison & Steele's definition of a serious (superior) programmer is a nice ideal for certain types of products.

Remember that different product types demand different measures of excellence.

Robert

Monday, July 2, 2012

A Fix for K & R Chapter 1

The Kernighan and Ritchie (K & R) book, The C Programming Language, 2nd Edition, has a trouble-some code snippet in chapter 1.    Many of the examples in chapter 1 have this test:

getchar() != EOF

This test might have worked 20 or 30 years ago, but it does not work well with modern keyboards.  If you code and run the examples with this code snippet, then to simulate the EOF character you have to use this combination in the Eclipse IDE:  Enter Control-z
In the Code Blocks IDE you need to do "Enter Control-z Enter"

You are better off modifying the program this way:

getchar() != '\n'

Now the program exits the while-loop when the Enter button is hit.

Robert