Alex Papadimoulis

Founder, The Daily WTF

Sep 2007

Serializalicious

by in Representative Line on

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.


Diary of a Third-Class Programmer

by in Feature Articles on

Most first-class (consultants & employees) and second-class (contractors) programmers don’t realize that there’s an entire class of programmers below them. These programmers – the third-class programmers – work in Developer Purgatory with far less responsibilities, no latitude to make any decision at any level, and always get assigned the “dirty work.” In fact, some even consider it an act of charity to call these poor folks “programmers” at all.

Most third-class programmers are third-class for a reason. There is simply no way they could ever get a job anywhere else. Occasionally, recent graduates get sucked in to Developer Purgatory by the allure of a “real programming job,” never realizing the stigma that goes along with it. Andrew is one of these poor souls, desperately trying to get out. And this is his diary.


When an Enum's an Enum

by in CodeSOD on

Barry R. and Rob P.'s coworker had a problem: how could he really, really make sure they verify that a value stored in an enumeration, say the EmailsFormat enum, is actually a valid value for that enumeration? With the handy FromEmailsFormat function of course!


The Mythical Business Layer

by in Alex's Soapbox on

If you’ve developed software for long enough, you’ve most certainly heard of a “business logic layer.” It’s supposed to be the layer (or “tier”) containing an application’s business logic and is sandwiched between a “persistence layer” and a “presentation layer.” Some call that the “standard three tiers of an application.” But what it really is, however, is a bad design that leads to bad software. Or at the very least, dangerously poor semantics. In lieu of your standard WTF article, allow me to explain why.

First and foremost, we need to define the term “business logic.” Unlike so many other entries in the IT lexicon, “business logic” has no standard meaning. We’re left with what you think it is, what your colleague wants it to be, and what some article you read says it is. So, for the purpose of this article (and hopefully beyond), here is my definitive definition.


containsNotEqualBackwards

by in CodeSOD on

Ahh, the things you can find in an old, gigantic system! Chris B recently uncovered this gem in an old Java application. It might be misnamed, but then again... how could one possibly describe what this is supposed to do...


All For 19 Seconds

by in CodeSOD on

Date and Time computations aren’t easy. Unless you’re fortunate enough to use Metric Time, there are a whole lot of uneven measurements to work with. Sixty seconds in a minute. Twenty four hours in a day. Thirty, thirty one, twenty eight, maybe twenty nine days in a month. Fifty two point something weeks in a year. It’s just ugly.

Fortunately, just about every programming language out there has library code to help with the math. Naturally, many “certain” programmers chose to ignore this library code and hack their own. Like Yuri’s predecessor. He was presented with a simple problem: add nineteen seconds to the current date/time in Perl.


Wish-It-Was Two-Factor

by in Feature Articles on

Unless you’ve just recently signed on to this whole Internet Thing, you’ve probably noticed an increasing trend in the World of Authentication. These days, when logging on to various websites, users are asked for a name, password, and the answer to one or more “secret questions.” It’s actually a new-fangled type of authentication called Wish-It-Was Two-Factor.

It all started way back in the year 2005, when the Federal Financial Institutions Examination Council issued a guideline entitled Authentication in an Internet Banking Environment. It’s a rather exhilarating read if I do say so myself, especially if you’re a fan of government banking regulations. And, really: who isn’t? In a nutshell, the FFIEC mandated that internet banks utilize a Two-Factor approach to authentication by year-end 2006.


Only $0.001 per Line

by in CodeSOD on

Generally speaking, $300 doesn’t go very far in the world of custom software. If you’re lucky, it might be enough to fix a typo in a production application. These days, with the advent of IT Project Portals (as discussed before) that provide everyone access to certain developers from certain countries, $300 can go a long way. Not long enough to build working software, of course, but surely long enough to generate lots and lots of worthless code. At least, that was the experience with Christopher’s client.

Christopher’s client is a large (as in, one of the “Big 5”) advertising firms that decided to initially place their RFP for a survey application on an IT Project Portal. A few months and $300 later, they ended up with about 500 PHP-files (31 of which are class files without any members) and a database schema that stores all values in VARCHARs. And it all “almost worked.” Fortunately, they had Christopher to help “debug” it.


Old Fashioned Web Services

by in CodeSOD on

When users upload a multimedia file to Toti S.'s company's website, their system transcodes the file into several different multimedia formats. At the high level, it's a pretty basic process.

1. User uploads file to Upload Server
2. Upload Server notified Transcoding Server via an XML request
3. Transcoding Server reads XML request and does its thing (creating various sizes/flavors of multimedia content)
4. Transcoding Server uploads various files to the Main Server


"Auto" Configuration

by in Error'd on

Consider this print configuration dialog that Quint came across...


Class Ego

by in CodeSOD on

Sometimes, there just isn’t a better way. You have to implement the DoNothing() method. Or even IsTrue(). At least, that’s what D.C. assumed when he saw a a class with a member variable named “self” …

 


I Didn’t Know You Could Do That!

by in Feature Articles on

Sebastian K.'s first encounter with Megan – a programmer in the company’s data verification department – came in the form of an innocent-sounding question: “how do I get the first value out of a variable?”

Having no idea what she was talking about, Sebastian inquired a bit further. Her code looked something like this:


Cognos Kōans

by in Error'd on

A frequent user of Cognos PowerPlay, Tom Murray shares some of its more insightful error messages...


It's Like a Double Yellow Line, and More!

by in Tales from the Interview on

It's Like a Double Yellow Line:

Near the end of a technical interview, Paco H. was asked a rather blunt question from the candidate he was interviewing: "Hey, be straight with me. How am I doing?" Paco replied with the truth: not too well. The candidate was a bit disappointed, so Paco gave him a chance of redemption.


SKU'd

by in Error'd on

Kyle was in the market for a bluetooth GPS device and stumbled upon this company who had a rather interesting SKU Number scheme ...