Follow your bliss, then write your tests December 27, 2007
href="http://hackety.org/2007/12/24/thisHackWasNotProperlyPlanned.html">_why
suggests that
…chaos is an essential component of writing code.
The system is too big for you to fathom. So you are always finding
yourself in unfamiliar territory. And once you fathom the system, it
becomes too boring and tedious to pay attention to details……Unit testing, in particular, is designed to reel in
spontaneous hacking. It is like framing a picture before it has been
painted. Hacking, at heart, will continue to be something of
spontaneous order, something of anarchy, and the landscape of hacking
is something which comes from human action but is not of human design.
I, as you already know, am a huge advocate of unit testing,
constantly poking my coworkers to get off their asses and cover all of
ours by writing the tests I believe our code so desperately needs…
But unit testing doesn’t have to be an either or
proposition, and I am in full agreement with the essence of _why’s
message. Some of the greatests hacks, like some of the greatests
stories, have come from simply opening yourself up to possibilities and
seeing where they take you. There are many good arguments to be made
for Test Driven Development, but when I’m writing the really cool code,
I frequently haven’t a clue where the methods will take me. But that’s
not a valid excuse for blowing off tests. Sure, follow your bliss. See
where it takes you, but, when you get there you will have time to look
back upon your creation while it’s still fresh in your mind and decide
if it’s something worth keeping. If it is, then it’s probably worth
making sure it works correctly, especially if it was written in the
midst of an endorphin high.
And… if, when looking back upon your creation, you think it’s good
enough to share, is it not ever more worth testing, so that your
entirely human errors don’t trip others up too? So that you can be sure
that things really work for others the way you claimed they did? How
inconsiderate of your fellow men would it be to foist untested and
potentially buggy code upon them?
There is no binary in this world; not in code or computers. Beauty and
motion lie not within the ones or zeros but the infinite layers of
transition between them.
Popularity: 5% [?]
Leave a Reply