Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Design

Two by Two


Verity Stob: Two by two

Monday. "A lot of weather about today", observes the Breakfast TV she-forecaster, correctly. Arrive at work soaked to point of edibility, temper and climate a matching pair, to find Mike "Horatio" Nelson sitting in my chair, using my PC. Horatio, as we are not allowed to call him, is a recent recruit; pompous beyond his five-and-twenty summers with a florid complexion, spectacles and a Pooterish moustache.

I say, "Good morning Mike. How can I help?"

He says, "I am your pair."

I say, "You are my what?"

He says, "Did you skip Friday's meeting? The company has decided to try the Extreme Programming methodology. Embrace Change! and all that."

I say, "By all means you embrace it, but at your own desk please."

He says, "Actually I think you'll find that Mr. Webster wants me here."

To the manager's office, where I enquire of Eric "Noah" Webster (we are nickname-fixated here) what the blankety-blank is Horatio doing hanging around my desk, reading my email and babbling about XP? Noah gets embarrassed and explains that this is a new X-periment, ha-di-ho, and that he had sounded everybody out as to who should try it first and, quote, "You and Mike, Verity, seemed to be an obvious pair." Meaning: I am the dope to be sacrificed at the altar of the latest fad.

Fine.

Wednesday. Storm ongoing. TV news portrays gloomy family handing out hamster cage and video recorder from upper storey bedroom window of flooded house into inexpertly rowed dinghy. I reach work late and soaked for the third time in three days, where I am still being taught the tenets of Extreme Programming by The Man Who Knows; i.e., Horatio.

Horatio is (again) reviewing one of my modules, looking for what he describes as "smelly code." He triumphantly pounces on a function called Locked, noting that this does not conform to our naming standard: it should be "IsLocked." I admit this to be strictly speaking true — if gob-smackingly pedantic — and bring up the editor's Search/Replace dialog to fix it.

But no. Horatio stops me and barges me out of the driving position. He says, "You have to get Test Infected, Verity. You should never cut any code without first writing a test."

"But Mike", I cry, "how can you write a test of a name change? It won't compile. This is just silly."

"No matter", he replies, wagging his index finger at me, "we are going to do this by the book."

"And what about the code in the test itself?" I ask. "Must we write code to test that as well? How shall we know when to stop?" But he is not listening.

I think I see why they call it "extreme."

Friday. Ongoing flooding, storms, railway/commuter mayhem. For the sake of novelty, a small tornado has devastated a caravan site on the south coast. (Query to self: why do tornados, in all sizes and in all parts of the world, invariably attack caravan sites? Are they Prince Charles-style "unspoiled countryside" snobs? Are they attracted by the smell of chemical toilets?)

Relationship with Horatio now declined to barely speaking terms, because

1) He is sitting at my desk, using my PC. He has even had the temerity to set my screen wallpaper to a picture of a blonde TV nymphet called "Muffie the teenage muffin filler" or some such;

2) He continuously whistles through his teeth/moustache the Nancy Sinatra golden oldie These boots are made for walking, a tune that, once it has attached itself to one's brain, sticks there unshiftably like unobserved chewing gum to an incautious backside;

3) He has spent all week "refactoring" (== playing with) my working code and we have achieved stuff-all, and;

4) Cut to the chase. He uses tab characters instead of two spaces to do his code indenting.

Enough.

Monday. Rain throttled back to intermittent showers, floods subsiding and I absolutely insist that we actually write some code. Horatio reluctantly agrees and offers to let me drive for once but I say "No, go on, you are the expert, show me how to do it the XP way" all wide-eyed as though I Can Easily Believe It's Not Butter wouldn't melt.

As it happens, our first task is to write a library routine to compare two variants for equality. (More difficult than it sounds: raw memory comparison won't do it because the variant is the kludged data type from hell that can contain an integer, double, string or a multi-dimensional array of yet more variants.) I watch with interest as Horatio begins to indulge in the telltale displacement activity of the floundering programmer: declaring variables. After six hours' work, he has written three loops and a switch statement, supported by 23 variables of assorted types. This code does nothing but exercise the stack register.

How could I have forgotten the First Law of Meta-Methodology? "Evangelists of new techniques often get that way because they can't write code for toffee."

Tuesday. A clear sky at last, TV news switched from tragedy to comedy: the US presidential election. I get in early, delete Horatio's doodling and bang in a neat little recursive routine that I worked out privately yesterday. This not only compiles first off, it even passes the test infection Horatio had prepared for it.

When he finally arrives, Horatio is predictably baffled. "But how can a function call itself?" he whines.

"There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy", I reply, yielding to temptation and blowing Muffie a kiss.

At lunchtime I make the most of the November sunshine and head off to Sainsbury's for a mega grocery shop. On return I find Noah and Horatio standing by my desk. Says Noah, "I've asked Mike to help out in tech support for a while, so I'm afraid you'll have to press on with XP on your own."

I trawl my purchases, seeking a moment-encapsulating symbol.

"Here you are, Mike", I say. "Have an olive."


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.