Recent Articles

Nov 2011

Random Char and Triply-Random Double

by in CodeSOD on

"As a student, I don't really feel qualified to what good and bad code is" writes Dan, "at least, that's how I felt before landing my first internship."

"When I asked my 'mentor' why he didn't just use the Asc function (which I found after a few-second search) to convert a random number to a random character, he responded that this seemed cleaner."


Directive 595

by in Feature Articles on

As the Database Architect, Daniel always had a pretty good relationship with Gerald, the Application Architect. At least, as good of a relationship as two natural rivals might have. Their backgrounds were very similar – both worked in Oracle and both started programming in C – and they actually saw eye-to-eye on more things than not. Both architects knew which realms they owned – the Application Architect’s was clearly Java and the Database Architect’s was Oracle – but there was plenty of middle ground to dispute.

However, when the inevitable disagreement would occur, they’d resolve their differences as diplomatically as possible and rarely would need to involve the Chief Architect. It was exactly how the Chief Architect preferred it to be: calm, peaceful, and agreeable. And besides, the Chief Architect had plenty of more important matters to attend to, such as board meetings and other executive-y things.


The Andy Pattern

by in CodeSOD on

Although Andy had left for greener pastures generations ago, everyone on Julius's team knows Andy. Actually, it's hard not to know him.

It's not that Andy's code is that bad. It's certainly buggy and rarely works properly, but that alone doesn't make it memorable. It's more... the Andy in the code. Take, for example, this snippet of code from RFIDAndyJulRequest3.pde:


The Über Logger

by in CodeSOD on

The idea was sound: make a generic logger that could log anything and everything, anywhere and everywhere, anyhow and everyhow. Granted, there were already several open-source, commercial, and built-in logging options that basically did that already, but the Über Logger would sit at a level above all of these loggers and thus could log to another logger... or even all of the other loggers. At least, that was the theory.

In practice, the Über Logger turned out to be a little more... messy. "Basically," wrote Floyd, "this method is, naturally, copied-and-pasted on all of some 200+ ASPX files where logging is needed."


More Limitin', Wrong Major, and Parallel Universe Replacement

by in Tales from the Interview on

More Limitin' (from Andrew Warren-Love)
Even though his resume wasn't beaming as much as some of the others we received, we invited a man down to interview for either of two positions. One in the IT Department and one in the Software Group of the Engineering Department. Once he arrived, he was given a tour of the important parts of the company to encourage interest related to our company or our products just like everyone else we interview. By this point, 90% of candidates will ask questions on their own, and the rest will ask questions when prompted.

Instead, he replied in a Southern drawl "nah man, I'm good." For the rest of interview, he showed about the same level of enthusiasm.


The Anti-SQL Coalition

by in CodeSOD on

"There is a small coalition of developers at the office who are vehemently anti-database," writes Bob, "naturally, this faction also doesn't value 'experience' -- mostly, because they have none. At least, not outside their university studies. They'll often liken a database server to a file system, and suggest that it's just a convenient way to store blobs of data -- but everything else is inelegant bloat."

"Of course, since this coalition doesn't have any actual decision making power, their strong opinions remain just that, and we stick with a standard tech of technology. Of course, their attitude often leaks into the code, as in this example of a simple search query that was used to search for an employee by name. The trick is we have employees with accented characters in our directory but, if a user search for the name without the accented char (e instead of é), it needs to return the result anyway."


X Marks the Close

by in Error'd on

"This popped-up when I wanted to abort the installation of this network driver," writes Tjerk S., "makes sense I guess since there's a nice big X in the top right corner."


Enterprise Dependency: The Next Generation

by in Feature Articles on

A while back, I posted The Enterprise Dependency and then Big Ball of Yarn. They were both visual depictions of a good ole' enterprise framework that was "several dozen megabytes chock full of helper classes like IEnterpriseAuthenticationProviderFactoryManagementFactory. So, continuing in the tradition of the Representative Line, here's another representative dependency diagrams offers some insight into the pain that large applications' maintainers face each day.

"Someone was able to convince management that our software system needed a massive rewrite," notes Bob, "so, management commissioned the Next Generation project. After two years, it's turned into an over-architected abomination with over 1700 classes, and still growing. It is only half-functional so far, but it's in production and is replacing an easy-to-support legacy system which had around 100 classes."


Serious String Validation

by in CodeSOD on

"I've been given the task to port some old code to a new platform," writes João Neves. "While porting some Javascript string validation functions, something caught my eye. "

"Now my eyes are filled with tears."


Secure';

by in Feature Articles on

"Take a look at this bug," said Victor's boss. "It'll be a good way for you to learn our code base."

Always a fan of the hands-on approach, Victor agreed. He pulled up the code and took a look, expecting to see a nicely bulletproof application. The system was a hosted service that allowed customers to store very sensitive technical data. The interview process had stressed exactly how sensitive the data was. "Security is job one," the boss said. "We spent a great deal of time and effort to make sure this was as secure as we could make it, and I need to make sure that you'll comply with secure coding practices."


Bad News Enum

by in CodeSOD on

"Enums are bad news," Diego's boss would often say, "they don't add any real value to the code, and they're that much more 'bloat' from Java. I've been coding in C for 20 years, and did just fine without them."

Despite being the senior Java architect, Diego's boss had deep-rooted distaste for Java. Diego didn't really understand why there was such a hatred against Enums specifically, until he stumbled across some of the architect's code.


Google Earth(quake)

by in Error'd on

"It looks like the next big one has already leveled the overpasses in the city of Orinda, California," writes Christian, "or rather, there are some glitches in the elevation map data on Google Earth."


The Showstopping Fax Error

by in Feature Articles on

The year was 1999, and it was an exciting time to be alive. Although Shea wasn’t working at one of the burgeoning dot-coms, he was the head honcho of technology at a decent-sized law firm. And that actually meant something, since the lawyers-that-be were committed to gearing up to race down the information superhighway.

Law was – and largely still is – a largely paper-based industry. Motions, subpoenas, interrogatories, praecipes, and a myriad other documents need to be written, received, typed, faxed, mailed, and filed each day. Though an army of paralegals can go a long way in battling paperwork, an electronic document management system is a juggernaut that could handle any dead-tree onslaught. And it was Shea’s job to construct one.


Truth Enough

by in CodeSOD on

"I recently started on a contact that would make for a great Daily WTF story on its own," writes Kyle Y, "there's paranoid management, highly restricted internet access, no outside email... it's the works!"

" If I manage to stay for more than a couple weeks, I'll be sure to follow-up with a full report. But in the meantime, I wanted to share some code. I took a 'screenshot' of a representative snippet... though I suppose I should have printed it out first and snapped it on a wooden table."


Remotely Incompetent

by in Feature Articles on

"Welcome back, Susan!"  one of Susan’s co-workers said as she walked in the door.  As she strolled to her desk, the co-worker continued, "Hope you enjoyed your vacation.  You missed quite a fireworks show while you were away.  We lost an entire day’s worth of orders, bit of a nightmare."

Susan had spent last week at sunny resort with her family, and was trying to adjust back to the cold January mornings in Massachusetts.  Being greeted with the news that their ordering system had been offline for almost a day was not something she wanted to hear.


The Temporary Index

by in Representative Line on

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


$$.$$

by in Error'd on

"The little sticker next to the ATM said that the fee shown on the screen would be assessed," writes Matt, "I guess if I have to ask what $$.$$ is, I can't afford it."


The True Alternative

by in CodeSOD on

"I inherited a system that that has it's own special ways of doing things," writes Brenden Sharp. "There are lots of things in there warrant facepalms, but few things are at the level of The Daily WTF submissions. Well that, and I've just gotten so used to it that it doesn't faze me anymore."

"But recently, when I was tracking down a bug, found this very special code."


Aggressive Management

by in Feature Articles on

Not for the first time, Chuck was happy he didn't have any lawn ornaments. First, they were just plain tacky. But more important, is that the screaming lunatic with foam flying from his lips while beating on your door and screaming like his face was on fire might throw them through a window. In a way, the screaming lunatic was all the lawn ornamentation Chuck needed.

"After all I've done for you, you treat me this way?" the maniac schreeched while kicking at Chuck's front door. "Nobody does this to me! You'll pay you ugrateful little turd! You'll pay!"