xkcd: The workarounds that users invent.

As usual, xkcd speaks the truth, the whole truth and nothing but the truth so help me Google.

I’ve witnessed some of these epic workarounds that people invent when they don’t fully understand what’s going on. I’ve invented a couple of epic one’s myself, especially in new programming languages.

One (there are others…) specific example I remember of Epic Workaround Woo By @shawn_hamman was on a loan origination and servicing project many, many years ago in Visual Basic 6. I hadn’t been programming in it (VB6) for very long (at all, would be a more appropriate term) when I started on the project. It was during the ramp up phase and we were busy building a proof of concept to illustrate how the UI was going to function while the company hired the rest of the development team. The ‘proof of concept’ turned out to be the actual product in the end…

You may laugh at what comes next. I’m only a little embarrassed.

There was a requirement for a “combo box” that couldn’t be edited. The VB6 ”combo box”, by default, allows you to enter text or select an item from the drop down. The editable text, in this case, was an unacceptable situation. Not being used to Visual Basic and being relatively new to commercial programming and being pragmatic about software development I set about building a work around for this. I made a OCX component with this editable “combo box” and through an elaborate set-up of triggers, methods and checks made it un-editable. Essentially replacing the text in whenever it changed to what was there before, except when you selected an item which would then… you get the idea.

It did the job ok. Sort of.

The problem was that shortly after that the feature creature got hold of it and the OCX got a built-in label and validation… it kept growing. It was a problem because every time the OCX changed an elaborate update of the entire project had to happen on every developers machine, the old OCX had to be unregistered, the new one registered, Source Safe updated… for every bug fix. It took weeks.

Of course, a senior developer was hired eventually who took one look at my work of art, barked a laugh and pointed to the “list box” control.

Nein! I don’t think you can subclass a control in VB6. I created a new OCX, dropped the combo box in it and exposed only a couple of properties and methods in the OCX which I passed through to the combo box but overriding the bits I didn’t want… like text input.

This reminds me of a time when bad documentation lead to the same thing…we had some networking software that read UDP sockets (stateless, didn’t know if I was listening on the other end etc)

From what I understood on the docs, there was 19 UDP sockets….turns out they where 19 Multicast sockets (still UDP, but you have to subscribe to the multicast )…You google that, modify your code all before they see that you dropped out of the test…..only to trip up at the end….the data they sent, was quicker than what my crappy C code could read…

The good from this…I re-wrote the software in threaded C….rocked the house….turns out, the other people that passed this test used 19 computers…running….Windows