Mark Bowytz

Besides contributing at @TheDailyWTF, I write DevDisasters for Visual Studio Magazine, and involved in various side projects including child rearing and marriage.

Jan 2009

What the Ad? - RPG Edition

by in Feature Articles on

Back in the day, when computer graphics ranged between non-existent and lousy and system specs called for RAM amounts usually less than 256k, and floppy disks were still...floppy, games that relied mostly upon the user's imagination provided the biggest bang for their software buck. Instead of the up, down, left, right, B, A, etc., it was all about typing in verbose commands like Look, Take, Get, Kill, and so on. However, where these games lacked in the graphics and gameplay perspective (at least from the modern perspective), there's one thing that they often got right - simulating the mindset of the jerkwad dungeon master.

First, consider the "classic" Zork II. I'm sure that I'll catch hell in the comments, but I absolutely hate this game. Now, I don't have a problem with the storyline or lack of graphics, no, I hate Zork II because it's the type of sadistic game that sets you up to fail.  Basically, you could get to one point in the game, unable to proceed because you don't have a certain item...and you can't go back unless you have an old game save. Activision got what they deserved for buying Infocom.


The Mega Bureaucracy

by in Feature Articles on

Photo credit: 'digicla' at Flickr At my daytime corporate-type job, if I need to even sneeze in the general direction of a production environment, I need both a managerial and customer approvals with documentation solemnly stating that I thoroughly tested my changes and swear on a stack of MSDN licenses and O'Reilly books that I am NOT going to break anything as a result of my changes.  Sure, the whole thing is a pain (and admittedly, a necessary evil), but what Bruce W. has to go through beats the pants off of anything I've ever had to go through.

For the most part, Bruce loves his job.  He gets to work with a lot of intelligent and motivated people.  He has been developing a new system to support a new product that has the possibility of earning his division several million dollars per year and saving the corporate parent several hundred thousand dollars per year.  The net effect on the corporate parent's bottom line will be quite nice.  He developed a Web front end while a fellow developer put together the data feeds.  The initial development work was estimated to take about six weeks; pretty good since we only had eight weeks to work with. 


Whom Should I Say is Calling?

by in CodeSOD on

An Anonymous reader who is part of a team that works for a small company, maintaining a messy codebase of a large and expensive company writes, "We were having trouble finding why a particular PL/SQL Stored Procedure was failing. Inside the SP, we found the following:

IF .. AND p_program_name <> '[executable name].exe'
THEN   RAISE invalid_calling_pgm; END IF;

Cluster#$%&

by in Feature Articles on

Image credit: 'Mark Bowytz' - REMEMBER THE KRAKEN!!!It was a little past 4AM when Massimo's support pager went off, jarring him awake. Without even looking at the pager or logging into his laptop, he flipped on the television to Channel 242: the Video on Demand channel for the Italian TV broadcaster that he worked for.

Nothing.


self->Static Anti-Pattern

by in CodeSOD on

If someone comes up to you and says that they work in the video game industry you might think that he or she has an interesting job (and if you're a gamer, then it sounds they have an AWESOME job). Surely, in between marathon video game playing sessions, they would be working with some true geniuses on really cool programs instead of working with the regular schmoes maintaining the Batch Load Processing Report - right? Well, wake up from that dream, bucko.  The same bad coders from whom you inherited that insipid, "enterprise level" application get to make video games while you slave away for "the man".

Consider Andy Goth's submission.  After successfully integrating a flight simulator with an image generator and making it a sparkling gem of efficiency, maintainability, and clear documentation, he was given the task of documenting the high-level architecture and low-level implementation of which the following code is a part of.  In between writing Doxygen comments saying "This function does nothing" or "Use of this macro is a syntax error" or "Using this macro on the left-hand side of a multiplication will result in zero", considered if it would take longer to finish his documentation or ask management if he could throw away the old code and rewrite the entire application from scratch.


Revenge of MUMPS Madness!

by in Feature Articles on

Photo credit: 'digicla' at Flickr Tyson wasn't used to 8:00am meetings, let alone meetings with the not-so-technical-even-though-their-name-implies-it Application Auditors on the dimly lit 32nd floor. Arriving fashionably late at 8:06, he was struck by how many suits were in the meeting with him - and he'd again opted not to shave.

The middle-suit seated across from him began, "Tyson, let me cut to the chase - there are some serious flaws in your CASTLE system."


Longjmp - FOR SPEED!!!

by in CodeSOD on

For those who don't know, there is a standard C header called setjmp.h that defines two methods: longjmp() and setjmp(). The longjmp works just like a goto statement in C in that, when executed, the program jumps to another pre-defined point in the code, defined by a setjmp. However, where goto is limited to the current, local scope, longjmp can span outside of the current scope and across functions.

If goto is considered harmful, then longjmp() should definitely be considered dangerous. As in, thermo-freakin-nuclear bomb dangerous. Fortunately, its complexity and frequency of use seem to be on par with that of a nuke, and most C developers have not brought it in their everyday. Most. And then there are the folks like Giovanni Verza's predecessor, who left behind functions like this.

/* this subroutine is called thousands of times.
use longjmp instead of loops to increase speed.
Daren 12/03/05 */


void
calculate(struct salesinfo*sales){
        jmp_buf buffer;
        int i=setjmp(buffer);

        if (!(i<sales->count))
                RETURN_NOTHING;

        addvaluetosubtotal(sales->values[i]);

        if (i<sales->count){
                longjmp(buffer,i+1);
        }
}

The Revealing Spreadsheet

by in Feature Articles on

Photo credit: 'Life in LDN' at FlickrWhen Glen Sommers was hired to add some features to a Cold Fusion based web application for a non-profit organization, he wasn't surprised by the quality he found, instead he expected it.

The application, whose sole purpose was to manage registrations for a organization's annual conference, was a learning experience for the original developer (who apparently did the work for free).  Among its many WTF's, the app used a grand total of 1 database table with 50+ columns with generic names like PackageOne, PackageTwo, PackageThree, and so on, but The Real WTF™ was the application's security...or rather, the lack thereof.

The URL Hack


Enterprise Level Access

by in CodeSOD on

Some time ago Martin F. was sent in by his IT consulting company to help fix some problems with the HR Database at a major European banking / insurance firm.  He admits that the WTF worthy warning signs were there at the onset (among them being that he was the 4th in a series of consultants assigned to this project), but being relatively naive to such things, he accepted the position and spent a year shaking his head in bewilderment and, at the same time, his fists at Rob.  He was an HR 'specialist' and a true IT genius who had a self-proclaimed hobby of programming in Visual Basic and was, of course, long gone from the corporation.

The HR Access-pool

The problem database held monthly snapshots of information about all the (over 50,000) employees of the bank, such as their names, DOBs, home address, function, fixed and variable salaries going back about 4 years.  Over that period of time, it had expanded to an impressive 2 Million records in size which is not unheard of in any large corporation, but your typical "Select and Group By" query on 200 people took about eight minutes.  However, as Martin came to discover, this was mostly due to the fact the corporate HR database was in reality an Access database sitting on some network fileshare.