Alex Papadimoulis

Founder, The Daily WTF

Nov 2007

Absurdly High "Values"

by in CodeSOD on

Brian works for a web development shop with an all-too-common formula: lots of intern labor and a very high turnover. As a recent hire, a large part of Brian's job is maintaining old sites developed by various former employees.

"I was recently asked to investigate a bug," Brian wrote, "where selecting a few publications from a multi-list caused strange errors and didn't store them correctly. When I initially went to check on the error, I noticed absurdly high "values" assigned to the problematic publications..."


Hyperverbosity

by in CodeSOD on

When Andy G opened up libsymblogy.h (sic), he was relieved. Finally, some documentation! Of course, upon further inspection, Andy realized that the comments didn’t quite explain how the code works, how it interfaces with other modules, or even why it uses certain magic numbers like -13. Instead, every function had a comment just as hyperverbose and vapid as this…

// Description: Implementation of a C function having the special purpose of
// initializing three particular ex	ternal structure elements with arrays of
// stored values which define all symbol modifiers for a corresponding symbology
// datatype, i.e., airborne, land and naval platforms, sensors/emitters, etc.
// The function's input parameters represent the location of the stored data and
// the type of symbology the instructor/operator desires to view. The function
// operates on the presumption that these parameters are valid. The function
// first opens the stored data file and clears the appropriate symbol modifier
// structure depending on the given datatype.  Then the function populates three
// lookup tables with 1) stored indices destined for use as symbol modifiers,
// 2) stored ASCII representations of each symbol modifier row, and 3) stored
// ASCII representations of each symbol modifier column. The function's output
// parameters represent the filename, section, record and datum which was last
// read from the symbology datafile, if any. The function returns a byte
// value 0 when the desired symbol modifiers are successfully initialized.
// Otherwise, the function returns a byte value -13 if the symbology datafile
// doesn't contain the symbol modifier data

Who Says That Size Matters?

by in Feature Articles on

Not too long ago, The Powers That Be in the emerging eastern-European country of Latveria (as I’ll call it) decided that the time had come for a massive, central monitoring system that would be used to ensure the country’s security. SENTINEL, as the system would be called, involved data exchange between virtually every governmental agency, airports, financial institutions, transit systems, and so forth, all for the purpose of being able to track people and the money they spend. After well over a year of negotiations, The Powers That Be selected Christian B’s company to design SENTINEL’s enterprise architecture.

Over the next year or so, Christian got accustomed to the weekly Latverian commute: wake up at 4:00 AM on Monday, depart from Paris via airplane, arrive in Hassenstadt (Latveria’s capitol) several hours later, work five twelve-to-fifteen hour days, catch a plane back home, and sleep until noon on Saturday. He also got very accustomed with Latverian politics: The Powers That Be, especially those from the Ministry of Defense, were personally involved with almost every decision at every level. And they didn’t take criticism very well. One network engineer was fired on the spot (and some suspect, later executed) for disagreeing with a Latverian director.


Overruled by RemoveSpecialCharsExceptQuoteAmpersand...

by in CodeSOD on

Finding bad code in some old system you’ve come to maintain is one thing. Being tasked with adding bad code to a new system is a whole other type of pain. Paul G was lucky enough to experience this first hand.

After an hour or two of arguing that there is a better way of doing this, Paul wrote, I was overruled by the longest serving developer and, as a result, forced to write the ‘Remove Special Chars Except Quote Ampersand Apostrophe Open Bracket Close Bracket Comma Hyphen Full Stop Comma Forward Slash’ function. Seriously.


Retard Rubber

by in Error'd on

Edward F wishes that some products weren't quite that honest to him...


Desperate Recruitment

by in Feature Articles on

The Beat on the Street in Peterborough (England) is that Data Interchange is looking to hire Software Developers. And I mean “on the street” quite literally:


Monitoring the Email Monitor

by in Feature Articles on

“Ummm…” the top email in Alex M.’s inbox started, “why did you delete my message about the approval bug? And then delete the message inquiring about the deletion? This issue isn’t going away – please investigate this right away!”

Had this been the first like message Alex had seen, he might have been surprised. But it wasn’t. For the past several weeks, customers, vendors, coworkers, and anyone else who emailed him received some rather interesting status notifications regarding their message. It was seemingly random and consisted of replies like “your message was deleted without being read,” “your meeting request has been declined,” or even “I will be out of office for the rest of the day.”


Safety Critical Encapsulation

by in CodeSOD on

The idea behind “information hiding” – i.e. encapsulating certain methods and properties to users of a class – is a fair idea in theory, but in practice, it’s just too slow. Think about it. If a “public” method just ends up calling some “private” method, that’s just a waste of a call. And if a lot of calls are made to that public method, then that’s a whole lot of wasted calls!

Vlad’s predecessor knew this fact well when he was designing “safety critical” functions for his company’s ------ application. Instead of wasting precious CPU time on “information hiding”, he put in a simple request to users of his class…


Finally, a Software Guarantee

by in Error'd on

Eric actually read the EULA for Office 2007 Compatibility Pack, and was happy to know that Microsoft will actually take responsibility up to five whole dollars for damages to your computer...


A Little More Simplified

by in CodeSOD on

After Travis took his new position he was amazed to find that the developers that he was replacing were completely unaware of the Date/Time library in the .NET Framework. Instead the relied upon time spans and complicated regular expressions for simple tasks, such as validating a string as a date...


(click for full size)


It’s How Everyone Builds It

by in Feature Articles on

The transition from computer technician to software developer can be pretty rough. Not only does one have to give up the chic company car (and, of course, all the hot dates it guarantees), but he has to land that rare technician job that has just enough programming work to stretch his job title on a résumé to “programmer.” Garret was lucky enough to find that job at a small computer repair shop we’ll called “AAAA Computers”

Garret’s official title AAAA Computers was “Technical Office Manager,” which came with a job description of “ya know, just do whatever it takes to run the shop ‘n stuff.” Being that Garret was the only employee at that location, this involved everything from fielding phone calls to sweeping the floors at night.


Identity Crisis

by in Feature Articles on

Developers-turned-dev managers often struggle to contain themselves when it comes to bug hunting. After all, they can usually resolve problems faster and better than the coders in their employ. The problem is, no developer wants a boss who takes more time explaining what must be done than it actually takes to do it. That leaves dev managers in the difficult spot of delegating the bug hunt and waiting for results.

As a newly hired development manager of a travel-bookings system, Dan E. found himself in this very situation. Overseeing a crew that was maintaining a fairly large ASP/VBScript codebase, Dan wanted to stay close to the technical details of the project while giving his coders room to do their jobs. So he simply offered some suggestions on what might be causing various error messages to appear.


A Penny Saved...

by in Error'd on

At first I was thrilled about the unexpected rate decrease, but leave it to AT&T to crush my excitement ...