In Other Words

by in Error'd on

We generally don't like to make fun of innocent misuses of a second language. Many of us struggle with their first. But sometimes we honestly can't tell which is first and which is zeroeth.

Whovian stombaker pontificates "Internationalization is hard. Sometimes, some translations are missing, some other times, there are strange concatenations due to language peculiarities. But here, we have everything wrong and no homogeneity in the issues."


Subbing for the Subcontractors

by in CodeSOD on

Back in the mid-2000s, Maurice got less than tempting offer. A large US city had hired a major contracting firm, that contracting firm had subcontracted out the job, and those subcontractors let the project spiral completely out of control. The customer and the primary contracting firm wanted to hire new subcontractors to try and save the project.

As this was the mid-2000s, the project had started its life as a VB6 project. Then someone realized this was a terrible idea, and decided to make it a VB.Net project, without actually changing any of the already written code, though. That leads to code like this:


The Programmer's Motto and Other Comments

by in CodeSOD on

We've got a lovely backlog of short snippets of code, and it's been a long time since our last smorgasbord, so let's take a look at some… choice cuts.

Let's open with a comment, found by Russell F:


Wise About Bits

by in CodeSOD on

The HP3000 was the first mini-computer that supported time-sharing. It launched in 1972, and HP didn't end-of-life it until 2010, and there are still third-party vendors supporting them.

Leonora's submission is some code she encountered a number of years ago, but not as many as you might think. It's in Pascal, and it's important to note that this version of Pascal definitely has bitwise operators. But, if you're programming on a 40 year old minicomputer, maybe you couldn't do an Internet search, and maybe Steve from down the hall had bogarted the one manual HP provided for the computer so you can't look it up because "he's using it for reference."


A Coded Escape

by in CodeSOD on

When evaluating a new development tool or framework, the first thing the smart developer does is check out the vendor documentation. Those docs will either be your best friend, or your worst enemy. A great product with bad documentation will provide nothing but frustration, but even a mediocre product with clean and clear documentation at least lets you get useful stuff done.

Stuart Longland's company has already picked the product, unfortunately, so Stuart's left combing through the documentation. This particular product exposes a web-socket based API, and thus includes JavaScript samples in its documentation. Obviously, one could use any language they like to talk to web-sockets, but examples are nice…


Swordfish

by in Error'd on

Despite literally predating paper, passcodes and secret handshakes continue to perplex programmers, actors, and artists alike.

For our first example, auteur Andy stages a spare play in three acts.
Nagg: Hello I'm not the account owner and shouldn't be logged in to this account. Can you help me?
Nell: Sure, here are the owner's credit card details. Please use those to say that you are the account owner.


Going Through Some Changes

by in CodeSOD on

Dave inherited a data management tool. It was an antique WinForms application that users would use to edit a whole pile of business specific data in one of those awkward "we implemented a tree structure on top of an RDBMS" patterns. As users made changes, their edits would get marked with a "pending" status, allowing them to be saved in the database and seen by other users, but with a clear "this isn't for real yet" signal.

One developer had a simple task: update a text box with the number of pending changes, and if it's non-zero, make the text red and boldfaced. This developer knew that some of these data access methods might not return any data, so they were very careful to "handle" exceptions.


Columns of a Constant Length

by in CodeSOD on

Today's submitter goes by "[object Object]", which I appreciate the JavaScript gag even when they send us C code.

This particular bit of C code exists to help output data in fixed-width files. What you run into, with fixed-width files, is that it becomes very important to properly pad all your columns. It's not a difficult programming challenge, but it's also easy to make mistakes that cause hard-to-spot bugs. And given that most systems using fixed-width files are legacy systems with their own idiosyncrasies, things could easily go wrong.


Archives