Debugging source is even harder when you can't stop laughing at it
- Reference: 1648456211
- News link: https://www.theregister.co.uk/2022/03/28/who_me/
- Source link:
This morning's story comes from a reader we shall call "Philip" (for it is not his name) and takes us to the 1990s when he was working for a company supplying color printers and scanning hardware.
Such devices were almost impossibly exotic back then and required all manner of upgrades to a vanilla PC in order to work. A full-length AT card was usually needed to provide the raw grunt that we take for granted these days.
[2]
As was so often the case, the cards occasionally failed and had to be replaced. A manual card index was used to keep track of things as broken hardware arrived and working kit was sent out. It worked about as well as you'd imagine. "We were quite proud if we only lost a few items a month," said Philip, "but management weren't quite so impressed by our finely honed skill."
[3]
[4]
However, the operations manager had contacts in the US and managed to secure the services of a student for six months. "Brad" (also not his name) would come to the UK on what Philip now reckons looked a bit like a modern zero-hours contract and do various work experience at the facility.
"He was an enthusiastic employee and took it on himself to learn enough Visual Basic to make a rudimentary replacement to our card index."
[5]
Like all too many quick and dirty Visual Basic/Access mash-ups of the time, it seemed to work pretty much perfectly after a few iterations. So much so that the business came to depend on Brad's work and the old manual filing system was filed in the bin. Brad eventually returned to the US, but the fruits of his labor lived on after his departure.
"After some time – I forget what caused it – an update was required to Brad's hard work," recalled Philip, "and we, the lads who were reasonably proficient at working at code level, were asked to break open his source and make the change."
"This is where things started to unravel."
[6]The IBM System/360 Model 40 told you to WHAT now?
[7]Prototype app outperforms and outlasts outsourced production version
[8]IT blamed after HR forgets to install sockets in new office
[9]IT advice fuelled by beer is the best IT advice of all, right?
Brad was a self-taught programmer, and the company had no concept of coding standards. Variable and function names that might be meaningful to his successors were an alien country to him. Instead he had used pretty much every offensive word he could think of as well as a good few we suspect he picked up from his UK colleagues.
"Scope" was also a concept with which Brad was unfamiliar, meaning that the swears might be global, local, and pretty much anywhere in between. His grasp was, as Philip put it, "variable at best."
[10]
We see what you did there.
As for the code, Philip and his team were left trying to work out what a function with a name that rhymed with "Chugger" - that took parameters more usually associated with bodily functions and body parts - actually did. "And that's just a reasonably printable example," he added.
Thanks to the puerile sense of humor of the team, coffee was often spat onto keyboards as the source was picked through. "All that laughter makes debugging code exceptionally difficult, believe me!" explained Philip. "If you've ever tried to debug an array of *****, or loop through ****, you'll sympathize."
"It took weeks of re-engineering to make sense of Brad's work," said Philip. "I lost touch with him but I sincerely hope he got a job with a major software vendor. That level of dedication needed to be recognized by someone."
And now it has. Today we have code reviews as part of many a DevOps process that should – we hope – mean that Brad's naming conventions will never again see the light of day. Or do you have a dark secret? A bit of code that revealed where your mind was wandering? Confess all with an email to [11]Who, Me? ®
Get our [12]Tech Resources
[1] https://www.theregister.com/Tag/Who,%20Me?/
[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2YkGHV2xcX@1BN9CVGAuuzQAAAM4&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YkGHV2xcX@1BN9CVGAuuzQAAAM4&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33YkGHV2xcX@1BN9CVGAuuzQAAAM4&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YkGHV2xcX@1BN9CVGAuuzQAAAM4&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[6] https://www.theregister.com/2022/03/21/who_me/
[7] https://www.theregister.com/2022/03/14/who_me/
[8] https://www.theregister.com/2022/03/07/who_me/
[9] https://www.theregister.com/2022/02/28/who_me/
[10] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33YkGHV2xcX@1BN9CVGAuuzQAAAM4&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[11] mailto:whome@theregister.com
[12] https://whitepapers.theregister.com/
I guess we all have done this and that I am not an outlier? Please? Or maybe at least 90% of commentards?
Not in any project that others would see, thank the maker. I do have some expletives in my source code, but milder forms. Plus some court has actually declared that swearing in dialect is not deemed (too) offensive.
Never did it - I got past finding offensive words "funny" before ten, I guess. Probably because I was exposed to good humor that doesn't need them.
Writing software for me was and is also a show of skills and elegance - not a show of how much childish I could be. But maybe I'm the outlier.
Tosser
I was going to suggest "twat", but I bow to your lead-off opinion.
I outgrew potty humor as well.
Given the amount of downvotes you already have, yeah, we're outliers.
Obviously never worked in a high-pressure job that used hospital humo(u)r as a pressure relief valve.
Lucky you.
It does not mean that the stress relief becomes part of the code base (or anything else that will outlive the current state of affairs),
Sorry, can't think of anything funny to say :-(.
"It does not mean that the stress relief becomes part of the code base"
Except it does. Or rather, from my perspective it sure seems to. I've seen it in every single large coding project I've ever worked on.
"(or anything else that will outlive the current state of affairs),"
And again, but it does. A single word or phrase uttered at the (in)appropriate moment will often send the aware listener(s) into gales of (sometimes stifled) laughter. The more solemn the moment, the more pronounced the effect. I once watched two members of a C-suite almost lose it completely as the Boss was reading carefully worded excerpts from the annual report ...
Trust but verify...
If Brad is still writing code, and now understands logical operations, I bet he's implemented base36 just to give himself some more options and/or a better possible vocabulary..
I run source code through something that checks for swearwords, licence keys etc before it's published...basically if I or a team member have made that mistake before, it's trapped here. The added benefit is that it keeps you up to date with current foul language:-)
Hint: Do not tell the junior team members about Roger's Profanisaurus, unless you like playing sweary whack-a-mole!
Re: Trust but verify...
"I run source code through something that checks for swearwords"
I can assure you that the English language is quite flexible enough to get objectionable phrases past any rules that they choose to implement. That kind of filtering is worse than useless in that it takes time to implement, doesn't work, provides a false sense of security, and opens the company up to lawsuit should an employee accidentally see something that they think was missed by the filters.
Student: "You wont find a single word in my paper that one couldn't say on Radio 4!"
Master: "Yeah, but not in that particular order ..."
Re: Trust but verify...
A slight aside...
Colleague at a job a long time ago received a mistakenly addressed email from one brother to another, expressing in colourful terms the older brother's dismay at finding out his sibling had come out as gay.
When he replied, to let the sender know the missive hadn't reached its intended recipient, their firm's email filter rejected it due to the level of profanity contained, none of which my colleague had added to...
Just another day
Looping through ***** is standard operating procedure for most companies. Glad to hear of someone clearly labelling it
Re: Just another day
From what I remember of the 9-5 grind, it was more loping through *****.
Re: Just another day
Yeah, just take a look at [1]https://thedailywtf.com/ for inspiration.
The appropriate words will pop into your mind. It is just that most never reach the vocal chord system or other's auditory system.
[1] https://thedailywtf.com/
Customer management objection to offensive code comment...
Some very-many years ago, when IBM used to release the source code of their various operating systems on microfiche, a customer hailing from the mid-West of the US (yes, yee-haw...) had complained to "IBM Management" that one comment in a 360-Assembler comms code module read:
"Retry 10000 times, for the hell of it".
The hapless originating IBM programmer was required to change the comment, so that next time round the source code line bore the revised text:
"Retry 10000 times" ...
It should have read : "Retry 10000 times and let us not irritate the poor little Mid-West yokels by saying why"
One wonders what the mid-west yokel thought of the word EBCDIC ...
something like this?
for (f@ck = 1; f@ck < 11; ++f@ck)
{
printf("%d ", f@ck);
}
return 0;
I pity the poor sod who have to fix such code... especially if the end result of f@ck is used somewhere else too...
So does ++f@ck count as an in-built f@ck-up all by itself?
Window titles too
A common window title in our department was "X blows goats" or similar. There were also conditionals or loop endings of the style "fat_lady = has_sung".
I don't see how a reference to the opera is a bad thing.
We all know that it ain't over 'til the fat lady has sung. It's tradition.
You obviously haven't met the head of Personnel HR ...
Been there, done that, tipped the swear jar
And i'm not the only one ...
There is some sense of relief when trying to debug someone else's code and come across a comment of
// FFS
or code that has been written by team A, then handed over to team B and has comments along the lines of
// who in their right mind thought this was a good idea
#ifdef BURN_IT_WITH_FIRE
[.. lots of code ]
#endif
And I've seen similar comments around my own code, that was coded up ever so clever and making use of arcane template knowledge that meant my code was awesome, extremely succint, nicely formatted and impossible to modify without basically having to rewrite it from scratch
Re: Been there, done that, tipped the swear jar
And I've seen similar comments around my own code, that was coded up ever so clever and making use of arcane template knowledge that meant my code was awesome, extremely succint, nicely formatted and impossible to modify without basically having to rewrite it from scratch
You wrote it in Perl?
A long time ago while at university writing a program in a functional programming language with an interpreter that was slightly less robust then a tissue paper ocean liner I had to insert a comment line with the text (translated) "If this comment line is removed the fing interpreter throws a fit and crashes!"...
Customer Code Reviews
I worked on a development whose customer was UK MoD. It was embedded code, so was never expected see the light of day. The contract allowed the customer the option of a code review as part of sign off. The MoD QA bloke, let's call him "Mike", was a pain in the arse* and, naturally, insisted on doing the code eview. There were many comments in the code along the lines of "..another error trap for a condition that can only happen in Mike's head...". No four-letter words or direct insults but he was very (and quite rightly, in hindsight) miffed by them and we missed delivery and incurred extra costs because of the work to take the comments out and repeat testing and, of course, code review.
*He also insisted on a formal test to prove that the keyboard worked - every individual key, every allowable key combination plus hours' worth of random multiple key-presses all tested, witnessed and recorded. It took two days, plus the time to write the test procedure and report.
Seen in some source code...
"If we reach here then the ladies bits are pointing skyward"