All 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.

17 Dec 2015

The Returned Value

by Remy Porter in Representative Line on 2015-12-17

Wilson Silva was looking through some production code, and found this representative line. This particular block of Ruby code was written by someone who claimed to have “lots of programming experience”. One must wonder what that experience was.

61 Comments - Last Comment @ 2015-12-23
26 Nov 2015

Be Thankful for Good Requirements

by Remy Porter in Representative Line on 2015-11-26

In the US, today’s the Thanksgiving holiday. As I learned from A Charlie Brown Thanksgiving, it’s supposed to be about friendship, family, and being grateful for what you have. In common practice, it’s more about gorging yourself.

While I was perusing our inbox, I saw that Matthew sent me a “flow chart” that represented a set of requirements from his sales team. Immediately upon opening it, I said, “Thank goodness I don’t have to work on this.”

96 Comments - Last Comment @ 2015-12-06
16 Jul 2015

Truely Representative

by Remy Porter in Representative Line on 2015-07-16

There’s bad code, and then there’s code so bad that you only need to see one line of code to understand how bad it actually is. Simon supplied this tiny horror which manages to combine all that’s wrong with PHP with the worst of loose typing and a thick layer of not really understanding what you’re doing.

Korean Traffic sign (Pass Left or Right)

94 Comments - Last Comment @ 2015-07-21
05 Feb 2015

How to Validate a URL

by Jane Bailey in Representative Line on 2015-02-05

INTERNET!There's an old joke among programmers, particularly those who have had to use regexes more often than they're comfortable with:

Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
It's a seductive trap: Regexes are good at processing strings, and are more complex than your usual string-processing utilities, so it seems logical to use regexes to do advanced string-parsing. But regular expressions are not meant to do arbitrary string parsing. Regular expressions are meant to parse regular languages. Furthermore, regular expressions are notoriously hard to read, resulting in, what appears to be, a string of random characters sneezed out all over your screen. For example, consider the following that's used for parsing a valid URL:

Regex regex =new Regex(

119 Comments - Last Comment @ 2015-02-16
31 Dec 2014

Classic WTF - One Bad Ternary Operator Deserves Another

by Mark Bowytz in Representative Line on 2014-12-31

Last day of 2014 means it's time to check out another year-end "Best Of WTF" article from earlier this year. Enjoy!

Personally, in all my years of application development, I have had zero use of ternary operators.

42 Comments - Last Comment @ 2015-01-06
03 Dec 2014

Nasal String Length

by Remy Porter in Representative Line on 2014-12-03

Dariusz isn’t sure what this line of code was meant to do. At his best guess, it was supposed to find an improperly terminated C string and add a null terminator character after it:

buf[strlen(buf)] = '\0';

103 Comments - Last Comment @ 2014-12-09
28 Oct 2014

Advanced Time Management

by Mark Bowytz in Representative Line on 2014-10-28

Whenever a computer wants to sync its internal clock, usually right around reboot, it'll check in with a time server. This is built-in functionality that spans across every modern OS.

Now, in some cases you might have a reason to disable the time check - and that's fine.

33 Comments - Last Comment @ 2014-11-02
02 Oct 2014

Ternary Operator Nesting Syndrome

by Mark Bowytz in Representative Line on 2014-10-02

Back in July, I wrote about my disdain for ternary operators citing a monster representative line as being a great example of an attempt at cleverness gone too far.

Well, an anonymous submitter sent our way another ternary operator disaster but with a twist - nested within the call to "payRecordsList.Add", almost every parameter passed has its own ternary operator added.

40 Comments - Last Comment @ 2014-10-07
08 Jul 2014

One Bad Ternary Operator Deserves Another

by Mark Bowytz in Representative Line on 2014-07-08

Personally, in all my years of application development, I have had zero use of ternary operators.

You might argue that ternary operators are useful in that they reduce the code footprint of an application of those unnecessarily lengthy if-then-else statements. But really...who are we kidding here? The only practical application of ternary operator is to either intentionally obfuscate your code or use it as a soapbox to brag about how "l33t" you are.

121 Comments - Last Comment @ 2014-08-10
02 Jan 2014

Productive Testing

by Remy Porter in Representative Line on 2014-01-02

Unit tests have many uses. Primarily, they’re the canary in the coal mine of our code, and alert us when changes are about to go horribly wrong. When Niels’s team saw a recent change broke their unit test, they instantly knew how to fix it.

In the DONE column of the kanban board, a post it reads 'Remove Failing Test'

60 Comments - Last Comment @ 16:11
21 Nov 2013

A Method Gone Too Far

by Mark Bowytz in Representative Line on 2013-11-21

The submitter of the below code, who chooses to remain Anonymous, recently started a job at a social media company as a software engineer. Seeing that they had never had anyone dedicated to their iOS product before, apparently they were quite excited.

Unfortunately for our submitter, the codebase is the stuff of nightmares - ternary operators stacked five deep on a single line, etc. There are no model objects, so they just pass around lots of dictionaries and strings thusly:

79 Comments - Last Comment @ 16:11
29 Apr 2013

It's not the size that matters

by Remy Porter in Representative Line on 2013-04-29

Arrays are one of the most basic data structures. They’re a primitive in nearly every language. In languages like C, they’re low level structures, which represent direct access to memory.

Wally’s co-worker, Brandon, wrote an array declaration:

175 Comments - Last Comment @ 16:11
11 Apr 2013


by Mark Bowytz in Representative Line on 2013-04-11

Let's say, hypothetically, that you need a bit of code to create a unique key in a database table that starts with an "N" and it MUST fit within the limits defined by a varchar(20) column.

You might think that transforming a database sequence ID might be a good way to go, but no, your project manager demands something more...robust. More unique. What to do? Well, Jay sent in the obvious answer: Use a GUID!

93 Comments - Last Comment @ 16:11
06 Dec 2012

Multiplying Strings

by Mark Bowytz in Representative Line on 2012-12-06

It was supposed to be simple. The plan was that Alex would temporarily inherit support an old VB e-commerce website for a week while a colleague was out on vacation. With the web being out there for years and years, Alex assumed that most of the old bugs had been squashed leaving him with a nice and quiet week on his hands. As it turned out, Alex had assumed incorrectly.

Shortly after taking temporary ownership, an issue arrived where small discounts were being hugely exaggerated on the invoices. Naturally, this resulted in the issue being made into Alex's top priority.

97 Comments - Last Comment @ 16:11
24 Jul 2012

Lucky Pointing

by Alex Papadimoulis in Representative Line on 2012-07-24

"When I look at the way that my predecessor wrote his code," Benedikt B wrote, "I can't help but wonder if he understood pointers as well as Kramer understood write-offs."

"The fact that our C++-based application manages to not crash for nearly a whole day is nothing short of a miracle, especially since the only decision process behind whether to use &, *, ::, or –> seemed to be whichever compiles and recovers the cleanest after a try/catch failure.

114 Comments - Last Comment @ 16:11
11 Jun 2012

Loose Cat Handling

by Alex Papadimoulis in Representative Line on 2012-06-11

"I had a pretty good idea of what I was getting into," Christian Riesen wrote, "the company I started at was very forthcoming about their codebase, and how it had grown organically over the past 12 years. I took the job because it would be a challenge to convert it from single files with tons of includes to a to a framework-based approach."

"One can ever expect the unexpected, and this job was no exception. Besides wonderful comments like 'we include this file here' (which is then followed by several include statements), there are many, many more weird things that defy any logic. Take, for example, this piece of code:

131 Comments - Last Comment @ 16:11
17 May 2012

Sanity Check

by Alex Papadimoulis in Representative Line on 2012-05-17

"Lucky me," Ryan wrote, "I got assigned to work on Legacy, an application whose name accurately describes itself. I'm pretty sure that this system manages to have a WTF/line ratio greater than 1.0, especially if we include the 'minor' ones, like the System.Environment.Exit calls peppered throughout library code that causes the app to inexplicably exit."

"But beyond minor annoyances like that, or the random number generator class that seems to exist solely to duplicate the behavior System.Random, I discovered this gem inside a class method."

160 Comments - Last Comment @ 16:11
19 Apr 2012

Simple Date Validation

by Alex Papadimoulis in Representative Line on 2012-04-19

Simple Date Validation "I'm very fortunate that my new job is at a cool company working with cool coworkers on cool projects," writes Dave via the Submit to WTF Visual Studio Plug-in.

"Of course, it wasn't always like this. Many years back, WTF Joe (as we now call him) was a key contributor to our codebase and always worked hard to find the hardest way to do the simplest things. Like date validation.

95 Comments - Last Comment @ 16:11
21 Mar 2012

Wyoming O'Clock

by Alex Papadimoulis in Representative Line on 2012-03-21

"There are so many things wrong with the project that I'm maintaining," writes Bruce.

"There's really only one way to show it all off: a representative line."

173 Comments - Last Comment @ 16:11
22 Dec 2011

JavaScript JSON Parsing

by Alex Papadimoulis in Representative Line on 2011-12-22

No data interchange format is perfect. ASN.1 (Abstract Syntax Notation One) is probably the closest (it's by far the most flexible and comprehensive), but since no one's really heard of it, it may as well be Esperanto. Although XML has become the de-facto standard, JSON (JavaScript Object Notation) has been gaining favor – especially for simple operations on the web.

For example, a JSON response to an authorization check might look something like this.

208 Comments - Last Comment @ 16:11
12 Dec 2011


by Alex Papadimoulis in Representative Line on 2011-12-12

"The project was done in C and it was clear the original contractor had no comprehension of function parameters," Aargle Zymurgy writes, "Imagine a source file with 20 functions in it, all modestly complex (between 10 and 40 lines) that only differed from each other by which global variable they operated on. Now repeat for dozens of other modules."

"But this was just the start of the global madness. For the user interface, various notions of up, down left and right were needed. In fact, those ideas were needed in dozens of contexts throughout the program. But what to do? You just have to innovate, of course! Thus the code had the following global variables."

174 Comments - Last Comment @ 16:11
07 Nov 2011

The Temporary Index

by Alex Papadimoulis in Representative Line on 2011-11-07

By day, Matthew is a highly-paid consultant that travels around globe helping companies develop and optimize application databases. By night, he's a un-paid consultant for a friend that supports a massive, vendor-provided system that cost well in the six figures. And like many enterprisey systems, the quality is inversely proportional to the price.

"They sent me a patch to help speed up the ledger reconciliation report, but it doesn't seem to do anything," Matthew's friend told him, "in fact, it seems to make things go slower."

125 Comments - Last Comment @ 16:11
19 Oct 2011

Bullet-proof Encryption

by Alex Papadimoulis in Representative Line on 2011-10-19

Matthew R recently took a team-lead position and was tasked with improving the quality of the company's application. He started with security, specifically the fact that user passwords were stored in plain-text. "But it's easier this way," the developer complained when Matthew suggested to change it, "plus, it's relatively easy to break modern encryption."


201 Comments - Last Comment @ 16:11
13 Oct 2011

The Deadly Cookie

by Alex Papadimoulis in Representative Line on 2011-10-13

Over the years, Armid transitioned from being a full-time developer to a full-time pen tester (as in penetration testing, not pen testing) and he hasn't looked back since. "I did enjoy writing code," he commented, "but there's something really satisfying about demonstrating an XSRF attack to that smug developer who swore up-and-down that his code was perfect." And with things like PCI Compliance to worry about, there are plenty of projects to keep him busy.

"It takes a lot to surprise me anymore," Armid added. "In fact, these days, I'm surprised if I don't find a SQL Injection vulnerability. That being said, the public-facing operations engine of a large (3,000+ employee) company really surprised me. To say that it was filled with back doors would almost imply that someone thought to install doors -- this system has more openings than walls. But there was one vulnerability in particular that trumped them all."

204 Comments - Last Comment @ 16:11
25 Aug 2011

Double Line

by Alex Papadimoulis in Representative Line on 2011-08-25

We've got two different representative lines from two entirely different systems.

The first is from Clay, who writes (via the Submit to WTF Visual Studio Add-in), "my coworker is a firm believer in highly-configurable systems and highly-descriptive property names. End result: a highly-obnoxious development pattern."

109 Comments - Last Comment @ 16:11
29 Jun 2011

How Not to Count Lines

by Mark Bowytz in Representative Line on 2011-06-29

 "Not long ago, I was poking around one of our production web servers and noticed the following curiosity in a shell script," writes Marshall G.

/bin/cat /var/run/netstat_r.lst | /usr/bin/wc | /usr/bin/cut -b -8 |perl -e 'my $r=<>; $r =~ s/^\s+//; print "$r"'

156 Comments - Last Comment @ 16:11
02 May 2011

The Vista Fix

by Alex Papadimoulis in Representative Line on 2011-05-02

"I was hired on to take things over from a fellow named 'Trent', who was known for writing some stunningly awful code," Michael writes, "I was not only to be tasked with rewriting one of our two main software products into a modern language (compared to the VB6 in which it was currently built), but in the short term I was also tasked with maintaining the older versions. "

"Before I started, I tried out our software (consumer utility stuff, registry cleaning, startup items and the like) and found it was crashing on my system. It turned out that the startup items had an issue for Vista users - Trent had hardcoded all of his directories rather than use environment variables, and so Vista systems would attempt to open a folder that simply did not exist.

192 Comments - Last Comment @ 16:11
30 Mar 2011

Fundamental Misunderstanding

by Alex Papadimoulis in Representative Line on 2011-03-30

If there's one phrase that Salvatore could attribute to his predecessor, it'd be fundamental misunderstanding. He had a fundamental misunderstanding of the business requirements. He had a fundamental misunderstanding of how to transform business requirements into code. He had a fundamental misunderstanding of how to write maintainable code. He had a fundamental misunderstanding of tools like source control. He had a fundamental misunderstanding of maintaining a modicum of documentation... even the passwords needed to access the server where the codebase (and production application) resided.

But of course, his colleague's fundamental misunderstandings went far beyond the world of software development and transcended into other areas, as this column from one of the database tables illustrates.

263 Comments - Last Comment @ 16:11
23 Feb 2011

The Interface

by Alex Papadimoulis in Representative Line on 2011-02-23

"I was (once again) re-assigned to another old project for upkeep 'n such," Johnny D writes, "and as it so happened, there was a bug. "

"A bug usually isn't that big of a deal... but this project had layers. And layers. And layers. And none of them are documented or commented in any manner.

236 Comments - Last Comment @ 16:11
10 Jan 2011

All In The Config

by Alex Papadimoulis in Representative Line on 2011-01-10

"From the first minute of the first hour of the first day of my job," Aaron writes, "I knew I had an epic WTF on my hands."

"I spent a while writing up a 1,600-word long description of this system, only to realize it wasn’t nearly enough. So I kept going. 1,950 words… still not enough. 2,300 words… barely scratching the surface.

238 Comments - Last Comment @ 16:11
22 Dec 2010


by Alex Papadimoulis in Representative Line on 2010-12-22

"In late 2009, I started a new job at a large logistics corporation," Nikos writes, "it was on my first day that I learned that 'quality' and 'best practices' can mean vastly different things to different people. Within my first week, I learned that I should probably ask a lot more questions about the system I will be spending 8 hours a day maintaining. Within my first month, I started counting my days."

"I've kept sane over the past year by telling myself that, one day, I would submit this whole thing to Alex at The Daily WTF. But I was never able to do that. Not because I was afraid (I'm sure I could have redacted/anonymized the code just fine), but because there was no way I could figure out how to compress this entire company and system into a single, concise story. And that's when I remembered about the Representative Line series.

142 Comments - Last Comment @ 16:11
11 Nov 2010

The Other If

by Alex Papadimoulis in Representative Line on 2010-11-11

There are two development teams at Matt T's company: his group and the other group.

For the most part, they work on the same types of projects, but the other group tends to do things a big differently. For example, Matt's group uses issue tracking software to manage requirements, while they use other means to track requirements. And although they don't champion best practices, they make sure to use other practices. The code they write isn't quite functional or maintainable, but it does serve other purposes.

179 Comments - Last Comment @ 16:11
11 Aug 2010

Boolean Illogic

by Alex Papadimoulis in Representative Line on 2010-08-11

One of the great things about Boolean logic is its simplicity. At the most basic level, there's simply TRUE and FALSE with AND, OR, and NOT. It takes a lot of work to overcomplicate such a simple system, yet "certain" developers seem to find such over-complication second nature. Take E.H.'s colleague, for example.

His impressive use of interesting semantic choices, redundant equality checks, and integer mixing make every line of code seem like a puzzle to solve. Take this line, for example.

160 Comments - Last Comment @ 16:11
02 Jun 2010

The Quotient ID

by Alex Papadimoulis in Representative Line on 2010-06-02

To say that the codebase at Andy’s client is sub-optimal would be generous. It’s a kludge on top of a kludge that was cobbled together by countless developers over many years. And as with many large and unwieldy information systems, distilling this beast into an understandable form is a challenge superseded only by the actual maintenance of the code.

As such, a brief snippet — a representative line if you will — offers perhaps our best glimpse into the heart of the system. And what a better place to look than its most tragic part: the database. Following is a portion of a line (a SELECT statement) that illustrates a pattern used over and over within the code.

108 Comments - Last Comment @ 16:11
21 Dec 2009

The Matryoshka Method

by Alex Papadimoulis in Representative Line on 2009-12-21

"At one end of the system," Steve A writes "we have a fairly simple HTML-form that displayed a handful of shipping-related fields. At that the other end, there's a database table that pretty much matches those fields one-to-one. But in the middle.... there's a lot more."

"It's so hard to even begin describing our systems architectural problems, let alone using code to illustrate them. So instead, I'll just share this single line — a function definition — from a VB6 .dll that's called a as a plug-in by another VB6 .dll, which is in-turn called by a VB6 .exe that runs as a service. This function calls a single stored procedure, which in turn calls another stored procedure that call other stored procedures. But eventually, a row gets inserted."

76 Comments - Last Comment @ 16:11
28 Oct 2009


by Alex Papadimoulis in Representative Line on 2009-10-28

"My company sells access to a massive PHP application that was built a few years ago by The Originals," writes Magnus Bergmark. "The application has everything: slow interface, quirks-mode invalid HTML4, hidden POST forms for every link, you name it."

"The code consists of a few files arranged in a proper developmestuction environment, with thousands of lines in each file. Comments are mostly devoid, but I found a line with a comment about one-and-a-half thousand lines down."

79 Comments - Last Comment @ 16:11
15 Jul 2009

The SQL String

by Alex Papadimoulis in Representative Line on 2009-07-15

"Our Senior Architect likes the idea of keeping things simple," Stephen B, "no stored procedures, no parameterized queries... just simple, simple strings."

"So, in keeping up with the 'simplicity', following is one line of code from one of the business objects in one of the modules in one of the layers in our system. I think it speaks for itself."

122 Comments - Last Comment @ 16:11
28 Jan 2009

The Great Code Spawn

by Alex Papadimoulis in Representative Line on 2009-01-28

Several years ago, Dan D’ predecessor, Steve, came to the realization that many of us arrived at one point or another: writing data-access code can get boring and repetitive. To ease the tedium, Steve did what many developers in his position do. He wrote some code to generate a lot of code.

Unfortunately, Steve’s coding skills weren’t all too hot. Worse were his code-writing-code writing skills. In the years since The Great Code Spawn (as it has come to be known), the data-access layer has become an unmaintainable disaster – so much so that, rather than add a new database column, developers have “split” single fields into multiple through bit-shifting and string manipulation.

123 Comments - Last Comment @ 16:11
16 Jan 2009


by Alex Papadimoulis in Representative Line on 2009-01-16

"Years ago," Mark wrote, "and long before I had started working there, the lead developer at my company tendered his resignation and starting up a firm of his own. It was a one-man consultancy built to service a single client: his former employer. They had little choice in retaining his services as, prior to leaving, he intentionally obfuscated all of the code.

"As part of Operation Obfuscation, he removed all of the unnecessary white space and (apparently) converted the code to all caps. Problems were compounded by the platform (some off-brand BASIC interpreter), his original choice of variable names (X, Y, Z, etc.), and the lack of any structures like subroutines. Developers came and, after hearing about code, quickly left. For a reason that escapes me to this day, I actually chose to stay and help them with their mess. It sounded like it could be a fun challenge.

139 Comments - Last Comment @ 16:11
17 Dec 2008

The Backup Snippet

by Alex Papadimoulis in Representative Line on 2008-12-17

Generally speaking, Andrew tries his best to avoid the DBA team. It's not just because database administrators tend to be a unique breed (his colleagues were certainly no exception), but because of the "things" that he'd heard about the team. The sort of "things" that keep developers up at night and make them regret not becoming an accountant.

One day, while debugging an issue with their monitoring scripts, Andrew had no choice but to check with Thom, a member of Team DBA. It turned out that one of DBA's had recently updated their database backup script, but Thom wasn't really sure who did it, why it was done, or what it looked like before. So, he just sent Andrew the entire backup script.

127 Comments - Last Comment @ 16:11
26 Nov 2008

Why Indeed

by Alex Papadimoulis in Representative Line on 2008-11-26

Having just inherited a mammoth, ASP-based ecommerce application created in a developmestuction by a handful of different consultants over several years, Ryan Davis found himself asking one question, over and over: why?

Why didn't they use some off-the-shelf ecommerce site? Why aren't there any comments, anywhere?? Why did anyone let the original developer near a keyboard, let alone allow him to program!? Why did I even bother coming in today!?!?

57 Comments - Last Comment @ 16:11
10 Jun 2008

HTTP 414: Way Too F#%&ing Long

by Alex Papadimoulis in Representative Line on 2008-06-10

Most of us web developers will never encounter an HTTP 414 Error. According to the W3C, 414 means:

Request-URI Too Long - The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret. This rare condition is only likely to occur when a client has improperly converted a POST request to a GET request with long query information, when the client has descended into a URI "black hole" of redirection (e.g., a redirected URI prefix that points to a suffix of itself), or when the server is under attack by a client attempting to exploit security holes present in some servers using fixed-length buffers for reading or manipulating the Request-URI.

111 Comments - Last Comment @ 16:11
08 May 2008

Very Specific Generics

by Alex Papadimoulis in Representative Line on 2008-05-08

"I'm as much a fan of Java Generics as the next guy," writes Jim Bethancourt, "why bother with writing all that type-specific code for common collections (or - gasp - losing type safety) when one can simply go  HashMap<String, SomeObject>."

"However, after working on several of my predecessor's projects, I think it's pretty clear that liked generics, too. But I'm gonna go ahead and say that he liked them juuuuuust a bit too much. This was one of way-too-many lines in the variable definition section of some (you guessed it) generic class...

181 Comments - Last Comment @ 16:11
28 Apr 2008

The Nightly Session Drop

by Alex Papadimoulis in Representative Line on 2008-04-28

“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…”

73 Comments - Last Comment @ 16:11
16 Apr 2008

Deep Copy

by Alex Papadimoulis in Representative Line on 2008-04-16

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?

159 Comments - Last Comment @ 16:11
04 Apr 2008

The Test of Truth

by Alex Papadimoulis in Representative Line on 2008-04-04

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);

118 Comments - Last Comment @ 16:11
30 Jan 2008

On a Budget

by Alex Papadimoulis in Representative Line on 2008-01-30

Not all of us are fortunate enough to work in "spacious, windowed private office" like the pampered developers over at Fogcreek. At my company (Inedo) for example, developers are constantly trying to figure out, do I get a chair today, or is it my turn to plug-in to the network? While I'm sure your work environments are equally less-than-ideal, not too many can compare with Baughn's experience.

"I was called in by a small company to make some minor changes to their software," Baughn wrote, "mostly language translations. Apparently, the normal maintainer had just up and quit."

151 Comments - Last Comment @ 16:11
03 Dec 2007

Perseverance in the Face of Change Requests

by Alex Papadimoulis in Representative Line on 2007-12-03

A lot of “certain” developers just don’t like change. They’ll stick to their architecture no matter what, and certainly regardless of the requirements change. Doing any less would compromise the “purity” their design.

The lead developer on John’s team is like this and was faced with “a really ridiculous change request.” The spare parts catalogue they were building needed to manage assemblies – i.e. a grouping of parts – as well as individual parts. The following representative line should give you an idea of how this was implemented...

101 Comments - Last Comment @ 16:11
12 Oct 2007

XML Kōan from the Fourth Dimension

by Alex Papadimoulis in Representative Line on 2007-10-12

John Y recently had to deal with an XML-like dump from a "4D" database. This dump used a peculiar form of abbreviation in which letters were chosen seemingly at random from field names, in order to meet the well known XML limitation of only allowing 5 characters per tag name.

Sometimes less than 5 letters were used. Browsing this file, John encountered the following Zen-like line.

104 Comments - Last Comment @ 16:11
28 Sep 2007


by Alex Papadimoulis in Representative Line on 2007-09-28

If you aren’t familiar with Serialization in Java, then today is your lucky day! Here’s a quick, crash course in Java Serialization:

Serialization allows instances of classes (i.e. objects) created at runtime to be saved and then later restored at a different runtime. While most developers could probably do this on their own with a GetState() and LoadState() method, Java can automagically do this on virtually any object by preserving its state to a sequence of bytes. All a Java developer has to do is add “implements Serializable” to their class definition, and voila! they can now save state with an ObjectOutputStream and instantiate states into objects with an ObjectInputStream.

79 Comments - Last Comment @ 16:11
07 Sep 2007

SELECT [Connection_String] FROM [WTF]

by Jake Vinson in Representative Line on 2007-09-07

Telly B. sent in a representative line that returns database connection information... from the database.

SELECT 'driver={SQL Server};user id=<removed>;pwd=<removed>;' +
    AS dbconn
  FROM users

85 Comments - Last Comment @ 16:11
06 Aug 2007

The Representative File

by Alex Papadimoulis in Representative Line on 2007-08-06

Dave works as a programmer in a small IT department within a large division of a gigantic company. Unlike his company’s Central IT, his division’s IT department doesn’t seem to hire regular programmers. Instead, they take people from within the division that have programming acclimations and stick them on the programming team. Combine this with the lack of a real development process, testing, or even user feedback, and a lot of interesting programs end up in production.

Instead of sharing a line of code to represent his department’s applications, Dave decided to send in the entire contents of a single file (“please.txt”) that was found amongst a number of other text files and executables within one application’s deployment folder...

47 Comments - Last Comment @ 16:11
13 Jun 2007

What, Me Layer?

by Alex Papadimoulis in Representative Line on 2007-06-13

In these days of Web 2.0, the line between outdated (and therefore obsolete) and retro (and therefore cool again) can get pretty blurred. Desktop Applications: outdated (unless they’re HTML-based or made by Google). Client/Server: retro (no green-screens please!). Tiered Design: retro (but only if at least two tiers are AJAX/JavaScript-based).

See what I mean? It’s hard to keep up. Greg Ward’s predecessors must have gotten pretty confused along the way as well. Following is a single line from their Web 2.0-based medical application.

45 Comments - Last Comment @ 16:11
23 May 2007


by Alex Papadimoulis in Representative Line on 2007-05-23

These days, Accessibility is all the rage. I wish I could say it was actually driven by §508 Requirements, W3C Standards, and an all-in-all good faith effort to allow “differently abled” people to access content. But it hasn’t. As long as we, the majority, can access content, that’s all that really matters.

Fortunately, the mobile revolution has forced us to go Accessible. Now that we need to access content with our “differently abled” smartphone gadgets, we need that content to be Accessible. Bonus for the “differently able” people, I suppose.

132 Comments - Last Comment @ 16:11
31 Jan 2007

Gaming Ground

by Alex Papadimoulis in Representative Line on 2007-01-31

I generally don't publish code from the videogames because I don't believe that code quality is as important in that industry. Short of the occasional patch, once the product is shipped, it's done; there's no ten-year lifespan to worry about.

That said, it's still important to maintain some level of quality. After all, there are several people that need to work on the game, if only during its brief development lifecycle. When Brian P saw the last Representative Line article, he knew that it was an ideal place to share this following line. It's from a title that has made it through the manufacturer's QA process and has just been released in Europe, the US and Japan ...

134 Comments - Last Comment @ 16:11
23 Nov 2006

Representative Line: Spreading the Holiday Jeer

by Alex Papadimoulis in Representative Line on 2006-11-23

For those of you stuck at work today, or in one of those 191 countries that don't celebrate Thanksgiving Day today, or -- *gasp* -- actually reading this from home while on holiday, here's a Representative Line that should get you in the holiday spirit. It's the subject of an email sent by the CFO to Mike and the rest of the company ...

New Expense Policy: No employee celebrations

81 Comments - Last Comment @ 16:11
14 Nov 2006

Representative Line: Tetricosanary Logic

by Alex Papadimoulis in Representative Line on 2006-11-14

Good news, everyone: it's time for a new series! Technically, this is not the first time that I've presented a 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. However, going back and renaming the old articles is a bit of a hassle, so I'll just pretend this is the first episode.

Today's Representative Line was uncovered by Hank Miller while he was "getting to know" a titanic system by fixing some of its bugs. This following function definition pretty much sums what the whole system is about ...

99 Comments - Last Comment @ 16:11