Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:3753571
Created Sep 20, 2012

@ChristinGorman gave this talk at JavaZone: https://vimeo.com/49484333 It's quite good, short, energetic, enthusiastic,
intelligent, and completely misses the point.
While it's true that the code she produces is much better than the original, and is quite easy to understand; it fails one
critical test. It's not polite.
Polite code is like a well written newspaper article. It allows you to bail out early. A well written article has a
headline, a synopsis, and a set of paragraphs that begin with the high level concepts and get more and more detailed as you
read through the article. At any point you can decide: "I get it! I don't need to read further." Indeed, this is how most
people read newspapers or magazines. The articles are polite, because they allow you to get out quickly.
Christin's code, simple as it is, does not let you get out early. You have to read through it to understand it. Granted,
there's not a lot to read, and it's pretty easy going. But still, there's no early exit. To understand it, you must read
it all.
Well written code should be crafted so that it is polite. It should approach detail gradually, the way a newspaper article
does. It should allow the reader to bail out early, as soon as they realize that they don't need to understand the whole
thing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment