Jane Bailey

Jane Bailey is a self-published author of urban fantasy novels as well as a part-time blogger; in their day job, they're a renaissance person, dabbling in all sorts of fields in search of interesting puzzles and finding mostly WTFs.

Jan 2015

A Shining Perl

by in CodeSOD on

Pan paniscus06Ah, Perl. Often derided as a "write-only language", Perl nevertheless enjoys some level of popularity among WTF-savvy workplaces. So when David inherited a codebase through the purchase of a company staffed entirely with, what he had dubbed "mentally challenged chimpanzees", it seemed only natural that the code was entirely in Perl.

Dealing with financial transactions is one of the key features required for any online shopping or banking applications, and as such, it's more or less a solved problem by now. So of course, the perl gurus at ChimpanCorp reinvented the wheel with their Real-time Financial Processing app. It would calculate the user's balance every ten minutes by compiling all data posted since the last calculation, leading to a balance that was never more than ten minutes out of date! Of course, that's as good as you can possibly get when the calculation takes nine minutes to run. Still, the client was wondering if maybe the could speed up the calculations so it could run, say, every five minutes? Or maybe, hypothetically speaking, immediately after every transaction?


The Java Purist

by in CodeSOD on

THIS IS PUREAli was what they like to call "Purist". You know the type by now: the man who's never met a piece of Java code that didn't need a refactor for the sake of "style". Too bad for him he was assigned to work on some code that had been ported to Java from other languages. It worked, but it wasn't Pure.

Nor was he sensitive to budget constraints or scheduling issues. On one fateful Friday afternoon, he couldn't take the impurity any longer. Over the course of around 6 hours, he committed dozens of minor revisions to source control, touching nearly every file in the codebase:

Revision Author Message
2345 Ali Replacing underscores with mixed case function names, as per Java standards.
2346 Ali Renamed function today() to now(), to better document the functionality of the code.
2347 Ali Replacing spaces with tabs, as per Java standards.
2348 Ali More replacement of spaces with tabs, as per Java standards.
2349 Ali Removed spaces at the ends of lines, as per Java standards.
2350 Ali Renamed unclear variables trigger_nm and table_nm to trigger and table.
2351 Ali Variable names MUST begin with a lowercase, as per Java standards.
2352 Ali Constants declared with final MUST be all uppercase, as per Java standards.
2353 Ali Alphabetized table listing, for readability.
2354 Ali Mass correction of indentation using Eclipse, as per Java standards.
2355 Ali Alphabetized function listing, as per Java standards.

Jack and the Beanstalk

by in CodeSOD on

beanOnce upon a time, in a far off kingdom named 1996, there was a developer named Jack. Jack worked for a poor company that could barely afford to buy grain with which to bake objects; they had to make do with Delphi forms, pinching and scraping what they could into an application. Instead of methods, they were stuck with button events, from which they milked database tables.

One day, Jack came to realize that the button events were growing old, and soon, no more good could be wrung from them. Sadly, he knew it was time to retire his old Delphi code. But what could he live on?