Recent Representative Line

A single line of code from a large application that somehow manages to provide an almost endless insight into the pain that its maintainers face each day.

Apr 2008

The Nightly Session Drop

by in Representative Line on

“Shortly after joining my new company,” writes Rajesh Subramanian, “they introduced me to The Monster: a massive, incomplete framework written in C++. Its documentation consisted of a few sparse, often contradictory comments. It was designed to be multithreaded, but always crashed with more than one thread. It was expected to run on different operating systems, but never quite made it past Windows 2000 SP3. And naturally, it’s filled with friendly variable names like s, t, pp1, pp2, and so on.”

“One of my first tasks – an ‘easy one’ – was to fix The Nightly Session Drop. For as long as anyone could remember, The Monster would disconnect at exactly midnight and reconnect a moment later. This would occasionally lead to ‘really bad things’ that could take all day to fix. So, after a half day of diving head first into The Monster, I found this line of code complete with comment…”


Deep Copy

by in Representative Line on

A little more than a year ago, Nathan T's company decided to outsource a large portion of certain project to a certain country many thousands of miles away. "Even if the code quality isn't as good," one manager would often say, "we'll just pay them to rewrite it and rewrite it again. It'll still be less expensive."

Extended that logic even further, management decided to not only outsource overseas, but outsource to the cheapest overseas firm they could find. Eventually, they'd end up with solid code, right?


The Test of Truth

by in Representative Line on

A few years back, Randy A took a contract as a maintenance developer on a wretched abomination of an application. Like those who've stared into the heart of the Great Codethulhu, Randy's retinas are forever burned with code from the system. One line that continues to haunt his dreams is as clear as the day he first encountered it...

return (test == true)? ( (test == false)? false : true) : ((test == false) ? false : true);