Coding: It's Just Writing

Posted by on under cornell university professor, william strunk jr, james devlin, strunk and white, timeless book, editis, elements of style, essential books, unnecessary words, simy, e b white, professor william, writing programs, millis, tenney, brevity, wikipedia, great |

In The Programming Aphorisms of Strunk and White, James Devlin does a typically excellent job of examining something I've been noticing myself over the last five years:

The unexpected relationship between writing code and writing.

There is perhaps no greater single reference on the topic of writing than Strunk and White's The Elements of Style. It's one of those essential books you discover in high school or college, and then spend the rest of your life wondering why other textbooks waste your time with all those unnecessary words to get their point across. Like all truly great books, it permanently changes the way you view the world, just a little.

Wikipedia provides a bit of history and context for this timeless book:

[The Elements of Style] was originally written in 1918 and privately published by Cornell University professor William Strunk, Jr., and was first revised with the help of Edward A. Tenney in 1935. In 1957, it came to the attention of E. B. White at The New Yorker. White had studied under Strunk in 1919 but had since forgotten the "little book" which he called a "forty-three-page summation of the case for cleanliness, accuracy, and brevity in the use of English."

The Elements of Style

A few weeks later, White wrote a piece for The New Yorker lauding Professor Strunk and his devotion to "lucid" English prose. The book's author having died in 1946, Macmillan and Company commissioned White to recast a new edition of The Elements of Style, published in 1959. In this revision, White independently expanded and modernized the 1918 work, creating the handbook now known to millions of writers and students as, simply, "Strunk and White". White's first edition sold some two million copies, with total sales of three editions surpassing ten million copies over a span of four decades.

This is all well and good if you plan to become a writer, but what's the connection between this timeless little book and writing a computer program?

Writing programs that the computer can understand is challenging, to be sure. That's why so few people, in the big scheme of things, become competent programmers. But writing paragraphs and sentences that your fellow humans can understand -- well, that's even more difficult. The longer you write programs and the older you get, eventually you come to realize that in order to truly succeed, you have to write programs that can be understood by both the computer and your fellow programmers.

Of all the cruel tricks in software engineering, this has to be the cruelest. Most of us entered this field because the machines are so much more logical than people. And yet, even when you're writing code explicitly intended for the machine, you're still writing. For other people. Fallible, flawed, distracted human beings just like you. And that's the truly difficult part.

I think that's what Knuth was getting at with his concept of Literate Programming (pdf).

Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.

The practitioner of literate programming can be regarded as an essayist, whose main concern is with exposition and excellence of style. Such an author, with thesaurus in hand, chooses the names of variables carefully and explains what each variable means. He or she strives for a program that is comprehensible because its concepts have been introduced in an order that is best for human understanding, using a mixture of formal and informal methods that reinforce each other.

This is, of course, much easier said than done. Most of us spend our entire lives learning how to write effectively. A book like The Elements of Style can provide helpful guideposts that translate almost wholesale to the process of coding. I want to highlight the one rule from Elements of Style that I keep coming back to, over and over, since originally discovering the book so many years ago.

13. Omit needless words.

Vigorous writing is concise. A sentence should contain no unnecessary words, a paragraph no unnecessary sentences, for the same reason that a drawing should have no unnecessary lines and a machine no unnecessary parts. This requires not that the writer make all his sentences short, or that he avoid all detail and treat his subjects only in outline, but that every word tell.

What does this say to you about your writing? About your code?

Coding, after all, is just writing. How hard can it be?

[advertisement] Peer Code Review. No meetings. No busy-work. Customizable workflows and reports. Try Jolt Award-winning Code Collaborator.


Tagi: cornell university professor, william strunk jr, james devlin, strunk and white, timeless book, editis, elements of style, essential books, unnecessary words, simy, e b white, professor william, writing programs, millis, tenney, brevity, wikipedia, great

Scientists ask: Is technology rewiring our brains?

Posted by on under teenage brain, google, circuitry, brains, scientists, peoe, parents |

What does a teenage brain on Google look like? Do all those hours spent online rewire the circuitry? Could these kids even relate better to emoticons than to real people? These sound like concerns from worried parents. But they're coming from brain scientists.
Tagi: teenage brain, google, circuitry, brains, scientists, peoe, parents

Bosch Holiday Deals from Ohio Power Tool

Posted by on under great holiday gifts, bosch tools, bosch tool, nbsp nbsp nbsp nbsp nbsp, free ups, tough tools, tool orders, simy, free battery, manufacturer warranty, worldwide free, mail, holiday deals, power tool, mth, new tools, launch, ups, lithium, december 31 |

FREE SHIPPING ON ALL BOSCH TOOLS! Until December 31st you can get free shipping on all Bosch Tool orders over $100 by simply using the coupon code BOSCH at checkout. You can also call 800-242-4424 and simply say you would like the free shipping on your Bosch Tools. Good for free UPS ground shipping anywhere in the continental US.

FREE PS20-2A & PS40-2A! Buy 3 PS20-2A or 3 PS40-2A and get 1 free instantly. These make great holiday gifts for anyone and at that price with the free shipping deal you will not find a better deal on the internet for these tools. These are all brand new tools with full manufacturer warranty, in the box with batteries, charger and case. Offer good until December 31st or while supplies last, limit 1 of each tool per customer, applies to all orders worldwide.

FREE BATTERY ON 14.4V & 18V DRILLS! This is a Mail-in rebate good on all the new Bosch Lithium Ion Drills. The Compact Tough & Brute Tough tools have been incredible popular since their launch a month ago. At 650 lb torque the 18V Brute Hammer has highest torque of any 18v drill on the market today. These tools are all very high quality made in Switzerland and priced very competitively with the 14.4v compact at only $199.       

        


Tagi: great holiday gifts, bosch tools, bosch tool, nbsp nbsp nbsp nbsp nbsp, free ups, tough tools, tool orders, simy, free battery, manufacturer warranty, worldwide free, mail, holiday deals, power tool, mth, new tools, launch, ups, lithium, december 31

Ridgid Calendar 2009-2010

Posted by on under ridgid tools, nbsp nbsp nbsp nbsp nbsp, calendar 2009, simy, free calendar, power tool, popular items, ace, calendars |


The new Ridgid Calendars are available now for 2009-2010. You can buy them directly from Ridgid for $15 + shipping. On the other hand if you order any Ridgid tools or accessories over $100 from Ohio Power Tool you can get one for free by simply emailing your name and order number to sales(at)ohiopowertool(dot)com and ask to have a free calendar send with the order. You can also call 800-242-4424 to place any order and simply tell them you would like a calendar with your order. We do have a limited number of copies and these are pretty popular items. Check out all the Ridgid Plumbing Tools at Ohio Power Tool.        

    


Tagi: ridgid tools, nbsp nbsp nbsp nbsp nbsp, calendar 2009, simy, free calendar, power tool, popular items, ace, calendars

Ridgid Calendar 2009-2010

Posted by on under ridgid tools, nbsp nbsp nbsp nbsp nbsp, calendar 2009, simy, free calendar, power tool, popular items, ace, calendars |


The new Ridgid Calendars are available now for 2009-2010. You can buy them directly from Ridgid for $15 + shipping. On the other hand if you order any Ridgid tools or accessories over $100 from Ohio Power Tool you can get one for free by simply emailing your name and order number to sales(at)ohiopowertool(dot)com and ask to have a free calendar send with the order. You can also call 800-242-4424 to place any order and simply tell them you would like a calendar with your order. We do have a limited number of copies and these are pretty popular items. Check out all the Ridgid Plumbing Tools at Ohio Power Tool.        

    


Tagi: ridgid tools, nbsp nbsp nbsp nbsp nbsp, calendar 2009, simy, free calendar, power tool, popular items, ace, calendars