The P.G. Wodehouse Method of Refactoring 133
covertbadger notes a developer's blog entry on a novel way of judging progress in refactoring code. "Software quality tools can never completely replace the gut instinct of a developer — you might have massive test coverage, but that won't help with subjective measures such as code smells. With Wodehouse-style refactoring, we can now easily keep track of which code we are happy with, and which code we remain deeply suspicious of."
Here's how I tell what needs refactoring (Score:4, Funny)
This sure beats the other literary refactorings (Score:5, Funny)
Re:This sure beats the other literary refactorings (Score:5, Funny)
Even better idea! (Score:5, Funny)
Need a status update? Just look into the room - if you can see sunlight, the work is done!
Wow, I like it! (Score:5, Funny)
Re:This sure beats the other literary refactorings (Score:4, Funny)
10 Never throw old code away.
20 If code is broken, GOTO 10.
Or you could just ask Jeeves to do it for you. (Score:5, Funny)
What ho.
Re:Here's how I tell what needs refactoring (Score:2, Funny)
Re:This sure beats the other literary refactorings (Score:5, Funny)
Adversity strikes when one least welcomes it Sir.
She claims my code 'smells'. I'll have her know my code smells as spiffly as a, as a, well, as a whatnot Jeeves.
Indeed sir.
Yes, a whatnot. I check my code against the very latest coding practices, and sometimes I even run it through unit tests!
Admirable qualities in a coder, if I may say, Sir.
Yes you may Jeeves. Now. to work! beastly testing.
Sir, perhaps one could use some automated tool or other method of achieving the requisite level of quality desired.
You know Jeeves, you've hit it right on the head there. I'll get Bernie Smetherington-Smythe to do it, he's such a ghastly bore but, well, when it comes to code review testing, there's no-one that can cut the mustard quite like him. Zip the source up Jeeves, we're to go pay Bernie a visit.
Certainly Sir, but what if Aunt Agatha finds out?
Pish Jeeves, pish! The auditors won't be around for months, no-one'll be any the wiser, and I can go to the ship-without-testing party after all. Life just falls into place sometimes doesn't it Jeeves? After all, What could go wrong?
Yes Sir.
Re:This sure beats the other literary refactorings (Score:5, Funny)
Very good, sir. Mr. Fink-Nottle, sir.
What ho, Gussie.
Oh, Bertie, thank heavens you're here! Someone is appropriating the prose style of the greatest author the English language has ever produced, and doing it in the most dreadful manner! He's even capitalizing the word "sir", and having Jeeves make interrogatory rather than simple declarative statements!
Sorry, Gussie, he did a simple what?
Oh Bertie, you ass, Jeeves would never actually question you! He would never say, "Certainly Sir, but what if Aunt Agatha finds out?" because that's a flat out question! Besides, he certainly wouldn't refer to your relative as "Aunt Agatha"! He might say, "Certainly Sir, but I might draw attention to the fact that Mrs. Gregson would take a dim view of such an approach." Bertie, you have to do something!
All well and good, Gussie old thing, but what am I to do? The hands of the Woosters are tied, as it were.
Not you, you fathead. We want Jeeves for this sort of thing!
Ah, of course. Jeeves?
Yo, Mr. B, what up?
Jeeves, if you could forego the anachronistic and inappropriate argot for the moment, we have a problem, or rather a sort of quandry which requires your attention.
Word. I talk my talk, yo.
Sharpen your wits, Jeeves, for this is unlike any you have faced before, and I fear that even you may not be up to the task.
De nada, boss. I got yer solution right here.
Jeeves? Do I hear correctly? We've not yet set the problem before you, and you have an answer for us?
Damn, bitch, didn't I just say that? Can't I hear my own self talking? Sh*t, I know what the problem is and I got the answer. It's self-referential code, dude. The problem is the solution, and vice versa. Get the code to recognize it's own faults, and set it to modify itself.
And we would then end up with...?
Undying prose, sir.
Yes, Jeeves. How appropriate.
With sincerest apologies to the Master, P.G. Wodehouse, whose writings gave me so much pleasure over the years, until I tried to write novels myself. Then they made me want to kill myself for my inadequacies as a writer.