{"id":3439458,"date":"2006-02-28T08:21:00","date_gmt":"2006-02-28T08:21:00","guid":{"rendered":"http:\/\/su.blog.bunty.tv\/2006\/02\/28\/Coding\/"},"modified":"2007-11-26T03:36:59","modified_gmt":"2007-11-26T03:36:59","slug":"Coding","status":"publish","type":"post","link":"http:\/\/su.blog.bunty.tv\/?p=3439458","title":{"rendered":"Coding"},"content":{"rendered":"<div class='sustuff'>Stumbleupon <a href='http:\/\/horsewithnobunty.stumbleupon.com\/review\/3439458\/'>Review<\/a>\n<\/div>\n<p> <\/p>\n<div align=\"center\"><b>\t\t\t\tCoding<br \/>\n\t\t\t\tBook Four<\/b><\/p>\n<p>\t\t   Thus spake the master programmer:<\/p>\n<p><i>\t      &#8220;A well-written program is its own heaven;<br \/>\n\t      a poorly-written program is its own hell.&#8221;<\/i><\/div>\n<ul>\n<p>\t\t\t\t  4.1<\/p>\n<p>A program should be light and agile, its subroutines connected like a<br \/>\nstrings of pearls.  The spirit and intent of the program should be<br \/>\nretained throughout.  There should be neither too little nor too much,<br \/>\nneither needless loops nor useless variables, neither lack of structure<br \/>\nnor overwhelming rigidity.<\/p>\n<p>A program should follow the &#8216;Law of Least Astonishment&#8217;.  What is this<br \/>\nlaw?  It is simply that the program should always respond to the user<br \/>\nin the way that astonishes him least.<\/p>\n<p>A program, no matter how complex, should act as a single unit.  The<br \/>\nprogram should be directed by the logic within rather than by outward<br \/>\nappearances.<\/p>\n<p>If the program fails in these requirements, it will be in a state of<br \/>\ndisorder and confusion.  The only way to correct this is to rewrite the<br \/>\nprogram.<\/p>\n<p>\t\t\t\t  4.2<\/p>\n<p>A novice asked the master: &#8220;I have a program that sometimes runs and<br \/>\nsometimes aborts.  I have followed the rules of programming, yet I am<br \/>\ntotally baffled. What is the reason for this?&#8221;<\/p>\n<p>The master replied: &#8220;You are confused because you do not understand the<br \/>\nTao.  Only a fool expects rational behavior from his fellow humans. Why<br \/>\ndo you expect it from a machine that humans have constructed? Computers<br \/>\nsimulate determinism; only the Tao is perfect.<\/p>\n<p>The rules of programming are transitory; only the Tao is eternal.<br \/>\nTherefore you must contemplate the Tao before you receive enlightenment.&#8221;<\/p>\n<p>&#8220;But how will I know when I have received enlightenment?&#8221; asked the novice.<\/p>\n<p>&#8220;Your program will then run correctly,&#8221; replied the master.<\/p>\n<p>\t\t\t\t  4.3<\/p>\n<p>A master was explaining the nature of the Tao to one of his novices,<br \/>\n&#8220;The Tao is embodied in all software &#8212; regardless of how<br \/>\ninsignificant,&#8221; said the master.<\/p>\n<p>&#8220;Is the Tao in a hand-held calculator?&#8221; asked the novice.<\/p>\n<p>&#8220;It is,&#8221; came the reply.<\/p>\n<p>&#8220;Is the Tao in a video game?&#8221; continued the novice.<\/p>\n<p>&#8220;It is even in a video game,&#8221; said the master.<\/p>\n<p>&#8220;And is the Tao in the DOS for a personal computer?&#8221;<\/p>\n<p>The master coughed and shifted his position slightly.  &#8220;The lesson is<br \/>\nover for today,&#8221; he said.<\/p>\n<p>\t\t\t\t  4.4<\/p>\n<p>Price Wang&#8217;s programmer was coding software.  His fingers danced upon<br \/>\nthe keyboard.  The program compiled without an error message, and the<br \/>\nprogram ran like a gentle wind.<\/p>\n<p>Excellent!&#8221; the Price exclaimed, &#8220;Your technique is faultless!&#8221;<\/p>\n<p>&#8220;Technique?&#8221; said the programmer, turning from his terminal, &#8220;What I<br \/>\nfollow is the Tao &#8212; beyond all technique.  When I first began to<br \/>\nprogram I would see before me the whole program in one mass.  After<br \/>\nthree years I no longer saw this mass. Instead, I used subroutines.<br \/>\nBut now I see nothing.  My whole being exists in a formless void.  My<br \/>\nsenses are idle.  My spirit, free to work without a plan, follows its<br \/>\nown instinct.  In short, my program writes itself. True, sometimes<br \/>\nthere are difficult problems.  I see them coming, I slow down, I watch<br \/>\nsilently. Then I change a single line of code and the difficulties<br \/>\nvanish like puffs of idle smoke.  I then compile the program.  I sit<br \/>\nstill and let the joy of the work fill my being.  I close my eyes for a<br \/>\nmoment and then log off.&#8221;<\/p>\n<p>Price Wang said, &#8220;Would that all of my programmers were as wise!&#8221;<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Stumbleupon Review Coding Book Four Thus spake the master programmer: &#8220;A well-written program is its own heaven; a poorly-written program is its own hell.&#8221; 4.1 A program should be light and agile, its subroutines connected like a strings of pearls. &hellip; <a href=\"http:\/\/su.blog.bunty.tv\/?p=3439458\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":""},"categories":[1381],"tags":[400569],"_links":{"self":[{"href":"http:\/\/su.blog.bunty.tv\/index.php?rest_route=\/wp\/v2\/posts\/3439458"}],"collection":[{"href":"http:\/\/su.blog.bunty.tv\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/su.blog.bunty.tv\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/su.blog.bunty.tv\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/su.blog.bunty.tv\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3439458"}],"version-history":[{"count":0,"href":"http:\/\/su.blog.bunty.tv\/index.php?rest_route=\/wp\/v2\/posts\/3439458\/revisions"}],"wp:attachment":[{"href":"http:\/\/su.blog.bunty.tv\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3439458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/su.blog.bunty.tv\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3439458"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/su.blog.bunty.tv\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3439458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}