By Template

by in CodeSOD on

Kimberly L sends us an example of what is clearly template-generated code, so I think this is an opportunity to go on a rant.

Now, the important thing to note here is that this code was in a packaged library that they were considering using.


The Next Version

by in Feature Articles on

Frequent contributor Argle (previous) is mildly famous, and not just around here. He writes:

Someone once remarked that they were jealous that I had two Wikipedia articles written about projects I created. This is about one of them.


Anno Domini

by in Error'd on

Buffalo, New York is a recovering Rust Belt city which has given the world several notable achievements. First, a fairly forgettable sliced meat sandwich au jus more known for its barely edible stale roll than for the entirely unremarkable beef entombed within. Second, an innovative repurposing of a castoff fowl appendage into a drunkard's delicacy (and Mlle Simpson's famed befuddlement). Most of all, it's indispensable for the construction of a lighthearted linguistic shibboleth: Buffalo buffalo buffalo buffalo... and so on. Unfortunately, the city also brings us bad news this week.

But first, Tony H. reminds us of a famously scandal-ridden bank. Theirs might not have been the worst fraud in 2016 (or 2017, or 2018, or 2019) but apparently they're now tightening down the screws on consumer lending. Tony observes, frostily, "a credit card with a limit below zero is alarming even for Wells Fargo."


Submit Your Vacation

by in Feature Articles on

"We have an internal website that shows, among other things, the daily availability of my coworkers for the next three months to help with scheduling, especially when planning vacations," writes Alexander.

"This vacation planner data is represented as a table. An image of a table to be more precise."


Heading On Out

by in CodeSOD on

Madeline inherited some Python 2.7 code, with an eye towards upgrading it to a more modern Python version. This code generates CSV files, and it's opted to do this by cramming everything into a 2D array in memory and then dumping the array out with some join operations, and that's the real WTF, because that's a guaranteed way to generate invalid CSV files. Like so many things, the CSV files are actually way more complicated than people think.

But we're going to focus in on a smaller subset of this pile of WTFs. I'll lead with the caveat from Madeline: "I've changed some of the variable names around, for a bit of anonymity, but couldn't get variable names quite as terrible as the original ones."


Show Thumbnails?

by in CodeSOD on

Christopher Walker continues to struggle against ancient PHP applications in the automotive industry. With the point system behind him, there was a whole pile of internal applications for handling information about laws, misconceptions about the law, and other driver services.

One, a home-grown CMS, was useful for publishing blog-style content about changes in the law. There was just one problem: if a post was published without a thumbnail, attempts to view that post failed with an error. It wasn't hard to find the offending line.


Spellchucker

by in CodeSOD on

There's an old saying in programming: you don't have to spell correctly, you only have to spell consistently. As long as you mispell everything the same way, your language will understand your code. However, most editors and IDEs have spell-check integration, though, because it's hard to get everyone on a team to spell things wrong consistently.

Unless, of course, you know just implement some bonus methods, like John's co-worker. This was frequently spammed in the Java codebase:


Classic WTF: Pure Eval

by in CodeSOD on
We close out our week with something evil. Someting… eval. Original. --Remy

When Jeff saw a line like this one, he knew there was something terribly wrong in the code he had inherited.

eval(Application("buildCommon").toString());


Archives