Y The Blog ?

Friday, April 22, 2005

How to survive a Code Walk-Through

I trod on this funny piece recently, originally from here:

"
A) Wrong.
Submitted code:
#include
main()
{
printf("hello, world\n");
}
Minutes of Review. Attending: Parity Stob (Programmer), Bill Dull (Token Peer Group Representative), John Straight (Testing), Ron Little (Design/Chair), Cheryl (Minutes).
1. Bill Dull said that Parity Stob had forgotten to do an opening comment. Ms Stob replied that she didn't think that it was necessary with so short a program. Mr Dull said, 'It may be obvious to you what it does, Parity, but it won't be so blooming clear to the poor man that's got to maintain it. I haven't been an AP/2 for 15 years without learning anything.'
The meeting actioned Ms Stob to add an opening comment.
2. Ron Little noted that the "hello, world\n" string was not capitalised, as it was in his design document pseudo code. Ms Stob pointed out that it was not capitalised in the master design document, from which Mr Little's document was derived. Mr Little stated that the master design document fell beyond Ms Stob's remit.
The meeting actioned Ms Stob to capitalise the "hello, world\n" string.
3. John Straight enquired if printf() returned a value. Ms Stob believed that it returned the number of bytes written to stdout. Bill Dull observed that it was company policy (and had been for 15 years) to collect all return values. Ms Stob enquired what the Dave Allen she was supposed to do with this return value once she had collected it. Ron Little reminded Ms Stob that the purpose of the meeting was to discover errors, not to correct them.
The meeting actioned Ms Stob to record the return value from printf().
4. Ron Little asked, 'What if printf() fails?' Ms Stob replied...
(Minutes continue in this vein for several pages)
...actioned Ms Stob to obtain a printout on nice green and white stripey paper.
The meeting adjourned. Ms Stob has 74 actions against her, plus one oral disciplinary warning (level 1). The code is to be formally re-reviewed, when Ms Stob has actioned the actions.

B) Right.
Submitted code:
#include
man()
{
printf("hello, cheeky");
}
Minutes of Review. Personnel as before.
1. Ron Little said, 'Talk about Freudian slips; isn't it main (), not man (), hur-hur-hur, eh Parity?'
Ms Stob replied, 'Yes Ron, you're right, what was I thinking of.' John Straight said, 'You were still distracted when you typed the string!'
Ms Stob couldn't think what had come over her. Bill Dull said that the } was out of alignment. Ms Stob was covered in confusion.
Ron Little said that, technically speaking, the meeting should minute actions against Ms Stob, but - hold on a sec. Cheryl love - since it was Our Parity, we'd say no more about it.
2. Bill Dull said he would go ahead and get them in at the EEPROM and Eaglet. A pint of Best, a monkey-juice for John and two halves of cooking lager top for the girlies, all right?
Ms Stob said that the girlies would have vodkas and tonics, thanks Ron.
3. The meeting adjourned. On the way out, Ms Stob winked at me.
"

0 Comments:

Post a Comment

<< Home