Shortcut for chapter specific information

Sunday, May 22, 2011

Zen and the Art of Motorcycle Maintenance (Part 4)

Finished another 40 pages of the book.   This is one of the most thought-provoking book I have ever read because it touches so many philosophical issues which a programmer/scientist should think deeply.   I start to follow the core of the argument.  i.e. what quality is.   I cannot overstate the importance of this topic to programmers.    Because all of us know we sometimes just encounter code which is good beyond description.  The extent of this problem is multi-level, it could be as small as whether

if(a>0) printf("%d\n",a);
else printf("%d\n",b);

is "better" than
if(a>0)
    printf("%d\n",a);
else
    printf("%d\n",b);

Or how should we add a new feature in big program written by object oriented programming.  (Think again if you think that there is only one way.)

Or why would we think that in a certain situation, nl is better than perl -lane '{print "$.  $_\n"}' or why are they are not as good as writing a separate perl script in others?  (Again, if you think only the command is better or if you think writing a perl script is better, you better think again.)

Or is it more correct to write a correct program with fewest number of lines? fewest number of characters? or it should be written with full commentary? or should we also give test cases?

Of course, this is just a very narrow aspect of "quality" which is discussed by Prisig.   His discussion of quality, though started from rhetorics are highly relevant to all skill-related works.   One can ask with similar rigor,  what is quality of cooking? what is quality of writing? what is quality of proofing?  what is quality of painting?  what is the quality of acting?  Those are among the most difficult questions which for the most time there is no satisfactory answers.

No comments:

Post a Comment