Feed the-daily-wtf The Daily WTF

Favorite IconThe Daily WTF

Link http://thedailywtf.com/
Feed http://syndication.thedailywtf.com/TheDailyWtf
Updated 2026-09-04 01:20
CodeSOD: Heating Up
A common option for retrofitting heating and cooling into older homes is a mini-split, frequently tied to a heat pump. They're (relatively) cheap to install, energy efficient, and can be added without substantial modifications to the home. They also, annoyingly, are mostly controlled via IR remotes, making them challenging to wire up to home automation or even a household thermostat.People have made solutions, and today's code comes from one of those solutions. Which, I want to stress, this code comes from an open source project for home automation, so it's not the code that's wrong, here. At first I thought it was, and had a moment of, "I'm not going to pick on some hobby project," but then I realised the hobby project points at a deeper issue.
What You Measure
Rachel joined a new team which was proudly "metrics driven". When she first met with her boss, Zane, he explained his thinking."We need to be data-driven to make good decisions, right? We're a manufacturing company. We make widgets. At the end of the day, we need to make the most widgets for the lowest cost of goods sold. So we track that, and that feeds into every decision."The team oversaw an automated production line, which meant the software was a mix of robotics, embedded firmware, high-level web based monitoring tools, and thickets of dreaded PLC code. And because you can't build an entire factory for test purposes, they only way they could test real-world scales with real-world data was to roll changes out to production. They could simulate, they could run tests on subsets of the system, but a change in the production line software couldn't truly be validated until it rolled out into the real world.Rachel's first task on the new team involved making some changes to their metrics dashboard. It was viewed as a good way to get her feet wet with the new team. As it turned out, the metrics dashboard was a Google Sheet, with a complex series of formulas that involved multi-level INDEX functions- essentially querying the spreadsheets like they were a database. Why not use an actual database? Oh, they did - six actually - but the company obeyed Remy's Law of Requirements Gathering: "no matter what the requirements the users ask for, what they really wanted was Excel". The database data was pulled into the spreadsheet for reporting.Now, a complicated sheet pulling in data from not one, but six different databases, they must have a pretty complex model to explain how changes to their software would impact productivity. And since they needed to model the software to make predictions about how it'd behave in production, that model must be extremely useful.Of course it wasn't. The only metrics they tracked were output metrics, variations on "widgets produced per unit time". There were some performance metrics, so you could maybe potentially identify "oh, our overall throughput dropped because unit 5 became a bottleneck and started taking 1.5 extra seconds per widget", but nothing that actually helped you understand how the complex system made decisions. Or even why unit 5 was taking longer.For example, there was an automated quality control scanner. It examined widgets as they came off the line, and rejected defective ones based on a computer vision algorithm. Did that subsystem record why it rejected a widget? No, it did not. The CV model was able to tag widgets with a defect category based on what it saw, but that information didn't get recorded anywhere. In fact, it didn't even record how many widgets got rejected. The only way to know was to have an operator on the assembly line count widgets in the bin manually. Since that ate up a bunch of an operator's time, it never happened unless the developers begged for it. And since the operator still couldn't answer the question "why was this widget rejected", it wasn't all that useful anyway.Every change to the software was scored against the overall output metrics. This meant that when Rachel was ready to push out her first software change, something that would record how many widgets were rejected and why, whether or not it could be deployed was dependent on seeing the change improve, or at least not regress, the widgets-over-time scores. But the widgets-over-time were a noisy metric; it varied based on which operators were working any given shift, or based on supply chain constraints. Or sometimes, based on when one of the machines was last calibrated- theoretically something that happened on a set schedule, but really was up to the operators. This meant the first three times Rachel rolled her code out for a test run, the metrics regressed. Nothing she changed should have impacted the metrics, but the metrics regressed due to environmental issues.This meant making a simple change could take weeks, because you could only do final validation on the real system, which means you had to mark off a block of time for a test run, you could only run a handful of tests a day, and if metrics regressed you had to account for that before you could release the software for actual production use.Over the first few months, Rachel added instrumentation to the code. Anything along the way to generating an output widget, she recorded. The hope was that once they had enough data, they could build a useful model of the system. Unfortunately, Zane had other ideas."So, you haven't improved our metrics," Zane said. "Which, I remind you, we're a metrics driven organization. Every change needs to improve our metrics.""Sure, but I'm gathering more data so we have a better idea of what makes our metrics tick. We don't know why our system does some of the things it does, because we don't record any logging about the decisions it makes.""Right, but we already gather the key metrics.""But you don't gather the data that tells you why those metrics are what they are!""Sure," Zane said. "But those aren't our key metrics."That, unfortunately for Rachel, was where things landed. Understanding their complex system was a low priority. Pushing top-level metrics without understanding what fed into them, that was the priority. That didn't mean Rachel was powerless: any time she made a change that she thought might help the top level metrics, she also made sure to add instrumentation that explained how that change behaved. It was the compromise that kept Zane happy: she released features that impacted the top-level metrics, but she also made the system more observable. [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!
Representative Line: So Much Room
Today's representative comment ran out of room.
Tales from the World Cup
All I can say in response to our anonymous submitter's story is, ALMOST?!
Error'd: Hello, New Mexico!
Peter G. shared with us yet another ordering bungled example of."Should really say "please engage in an Easter egg huntto find your language"."
CodeSOD: The Big Family
Some time ago, Charles shared with us some awful PHP, aka the most common sort. Today's code sample is maybe a little too big to sum up, but I'll let Charles take a crack at it.
CodeSOD: Lock 'Em Dead
Kevin sends us an exception handler from C++. Let's see if we can spot what's going wrong:
Representative Line: Both Ways Bug Me
There are many cases where some sort of debugging block sneaks by, especially cases where we see preprocessors or templates working, which leave us with nonsense like if (true == false) running in production. But Codemonkey found a new twist on that sort of thing, in a SQL query being run in production.
RCE As a Feature
The opposite of meritocracy is kakistocracy: the worst and least-qualified are the ones who rise to the top.Get real familiar with that word, dear readers. I think you'll need it.If anyone can back me up on this, it's our submitter, Jared B:
Error'd: Failure, After Failure, After Failure...
We have a couple from Foo (AKA Foo) today, include a special text copy-pasteFoo shared "I know you usually post image WTFs here, but here's a text output from chromium:
Representative Line: We All Register This
Today's maybe more of a "representative data sheet entry" than anything else.Every developer has the experience of reading the documentation. If you've been at this for some time, you've probably read bad documentation. Documentation that is incomplete, inaccurate, or otherwise flawed. Or, my personal favorite, the brief time where Oracle tried to put all of its documentation into an Adobe Flex site (aka, a Flash application, not a real web app). That one had fun bonus features, like "breaking copy and paste" and "preventing you from deep linking to a piece of the documentation".But software documentation has got nothing on bad data sheets. When you buy an integrated chip from a vendor, whether it's a microcontroller that'll run your code, a sensor you're trying to get data from, you're at the mercy of the datasheet for understanding how it works. Sometimes, even finding an English language datasheet can be a challenge. The more complex the chip you're trying to interact with, the more complex the datasheet needs to be, and at a certain point, a lot of vendors say, "meh, you'll figure it out." I've had chips where the datasheet and reality disagreed about what registers were available, which often means that core functions of the chip require twiddling undocumented registers. For more fun, they sometimes lie about which pins on the chip do which thing, including mislabeling which pins handle power. There's nothing more fun than the tiny little "pop" of a chip dying when you throw 5V power onto a pin that's actually ground.Now, there are some vendors, and some products, where the datasheets are pretty solid. This isn't a universal problem, but when you're working in an embedded space, "cheapest" is frequently the main criteria for picking components, and "cheapest" means "worst documented".Which brings us to Jarek's recent experience going through a data sheet. The chip in question had a "fantastic feature" that would change how debugging worked, which was for "super users" to enable by setting a register.
CodeSOD: Back to the Lab
Matlab is special. Scientists and researchers love it. Programmers hate it, and not just because it uses 1-based arrays. I've worked on a number of projects where the task was "take this Matlab code and convert it to C so we can run it on an embedded CPU". Somehow, in that process, I've avoided learning much about Matlab.Andre works on a team that uses Matlab to manage experimental scenarios. They wanted to do a simple task: generate a set of participant-specific images, store them in a database, and reference them later. Somewhere in the intersection of the database product they were using, the Matlab license they had, and other constraints, they discovered that there simply was no good way to do this.Enter "Jude". Jude said, "Don't worry about it, I can hack something together."I present the code in its entirety, but don't ask me to explain it. Instead, read the comments.
Floating Along
Today's submitter John F. was migrating data from a Microsoft platform to a Microsoft platform, using Microsoft tools. Absolutely nothing could go wrong, right?Right?
The State of Ticketing
Developing software can't simply be done with a text editor and a compiler. There are a variety of other tools we have to bring to bear that support our efforts and keep the team organized, like say, source control.There are certain tools we all have to use that I would argue, nobody has actually make a version that's any good. Build tooling is one of my go-to examples: there are no good build systems, only build systems that are good enough for this task.Another is ticket/task management. In fact, I'd go so far as to say, there are no good ticket management tools. Amongst the not good tools, I'd put Jira as one of the not goodest of all.What makes Jira attractive to companies is the same thing that makes it miserable, and the thing that infects any "enterprise" software platform and turns it into garbage: it has all the features and expect you to build your own workflows with it. You don't merely use Jira, you have to program your own interfaces in Jira to get your workflow into the system. And if you have the misfortune to have a project manager who thinks they're more technical than they are, they'll endlessly spin up new views, new workflows, and rearrange how the work is tracked in lieu of actually working.I've been on that team.One of Jira's features is the ability to describe the ticket workflow: the state machine that describes your process from the initial entry of the ticket all the way down to released software or project completion. This includes routing, so that as one team member does their part of the work, it automatically goes to someone else to do the next portion of the work.Which brings us to Klinsten. They were working on a new team, and wanted to change the ticket status from its current status to whatever came next in the workflow. So they looked at the workflow.These are two different versions of the same workflow, one with transition labels added, which as you can see, does nothing to clarify the workflow. That it's a mix of Dutch and English doesn't help matters.The purpose of this workflow is to help the team understand how to sequence and organize their work. But this workflow has so many states and so many transitions, it fails at this goal. Looking at it makes me just want to gesloten my browser tab, because this user isn't accepting any of this. [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!
Error'd: Zero to Zero in 0 seconds
"So many zeroes! I'm in." W00H000!Kivi S."found this ad in the wild. This must be avery large jackpot, look at all those zeroes!"
CodeSOD: Never Eating the Cookie
Maciej works as a freelancer, and that frequently means picking up old PHP code that nobody wants to support.One project had been lingering for ages with key features missing. Specifically, it was supposed to make HTTP requests to other services on an interval, and use that to populate its data. "The old dev tried, but never got it working." It was Maciej's turn to give it a shot.
Branching Paths
"You submitted a pull request."Indika was, in fact, reviewing the comments she'd gotten on that very same pull request, when her boss, Bill, walked up behind her. What she didn't understand is why Bill said it like it was an accusation."Yes?" she replied."Okay, well, we don't do that here. You're new, so I'll let it slide, but please review the developer guide."Well, Indika had reviewed the developer guide, or at least thought she had. As it turned out, there was the official, company wide developer guide. That's the one she'd read. But Bill maintained his own, for his team. He hadn't ever told her about it, but apparently assumed she'd have the oracular blessings of Apollo and find it by herself.It had this to say:
CodeSOD: Public Private Partnership
Eric O was trawling through an API for handling concurrency, and found this little mismatch between the comment and the definition:
The Crossroads
Error'd: Time Wounds All Heels
Looked to the past for some time-traveling entries to round out a themed post. They're 25% fresh.Robert apparently got a notification of a planned past delivery. It could be just a case of two systems that don't report different time zones, but even so, that's a wtf. Says he: "I just received an email from OnePlus this morning letting me know they have updated the planned delivery date for my order to Yesterday. I guess the delivery driver is going to time travel to get there on time since it still hasn't arrived."
A More Civilized Age
Greta (previously) sends us more updates from her "Ancient Development Environment".An important task an IDE must do is report build errors to its users. Arguably, that's one of the most important parts. I wouldn't know, I insist on building from the CLI all the time, because IDEs confuse and frighten me. I recognize I'm the weird one here, who is more comfortable in GDB than in a GUI debugger, but this isn't about me, it's about the IDE Greta is using.It needs to display an error. Why does it need to display an error? Well, Greta hasn't figured that out yet. The error I'm about to show you doesn't really explain what happened or why or give any hint as to what needs to be done to fix it. To make matters more confusing, it doesn't happen consistently, so simply re-running the build could potentially fix it.None of that is why we're here, though. What makes this a WTF is how the error is displayed:Greta shares her bullet points about what she hates about this:
CodeSOD: Connection State
Frederick A sends us a bit of null checking code, and offers us a better solution.
CodeSOD: Always Take the Option
Frequent submitter Capybara James sends us this simple snippet, which highlights that even when you have the lovely convenience of Optional types, you can use them wrong.
Lose Some Padding
Flat-file style databases were designed to fit the constraints of the systems they were running on. You specify your schema in terms of "how many characters in a file we use to store this data", meaning something like this: JOHNSMITH12343rdStAnytown PA12345 is read in my knowing that the first name field is 8 characters wide, the last name field is 8 characters wide, the street number is 4 digits, and so on.It's also a terrible schema, and woe to anyone with a long name. But many a mainframe had a similar schema.Now, let's think about maintenance here. What happens when we also want to store a middle initial? We've created for ourselves a problem. Somehow, I have to insert a character into every row, which basically means making a new table with a new schema, copying every record out of it and updating it to use the new schema. I can't just ALTER TABLE like an RDBMS. And worse, every piece of software that touches the table also needs to be updated. On a large legacy system, a simple task like "add a field to our database" could take weeks of developer time, and depending on the software, be a high risk operation.Which is why the smart developer, when working with flat files, includes padding. Maybe my schema for an address record looks more like this: JOHNSMITH12343rdStAnytown PA12345. That's 16 characters of padding at the end of the file. Now somebody says that I need to store a middle initial, I can just shrink the padding by one and add a middle initial field, like so: JOHNSMITH12343rdStAnytown PA12345QIs this elegant? No. But it works. I haven't changed the length of the row at all, so I don't need to move data around. Software modules only need to be updated if they care about what's in the middle initial field; if they're out of date, they just think there's a "Q" in the padding, and don't care.In real-world applications, instead of putting all the padding at the end, you'd usually put the padding in a few spots in the middle of the table. Any time you need a new column, you just steal a few characters from padding. Sure, someday you'll run out of padding, or at least out of padding blocks big enough for your new field, and then you'll have to do the hard work of shuffling data around. But in practice, you can get very far without that happening.Which brings us to Brenda's adventure. Her team supports an IBM mainframe storing data in VSAM flat files. In other words, they've been doing the sort of thing I just talked about for many, many years.Of course, in the modern era, you can't just leave your data sitting in an mainframe. Even if the mainframe is the source of truth, you want to be able to report on it and connect it with your other data systems. You need to, somehow, get the data into a modern RDBMS.So the company hired a bunch of developers to write an extract-transform-load process, which pulls the data out of the mainframe. The mainframe team handed them a "copybook" for the flat file, which described the structure, and the ETL devs went to work.And maybe those ETL devs didn't understand the importance of padding. Maybe they just missed the padding. Whatever it was, there were several places where the data was structured like SOME_USEFUL_FIELD PADDING PADDING PADDING SOME_OTHER_FIELD, and they opted to split it like so: SOME_USEFUL_FIELD PADDING PAD, DING PADDING SOME_OTHER_FIELD.When they released this process, it was fine. The padding characters got stripped before displaying, so the users never saw them. They were stored in the database, though, so when someone tried to reconstruct the data in a way that was compatible with the flat files, you could just concatenate the columns together and get a valid result.It was fine- until it wasn't. The ETL devs, bless their hearts, only tested against the production mainframe. And why not, they were doing read only operations, what's the harm? Had they tested against the development mainframe, they would have seen new features in flight, features which consumed some of that padding, and realized that they should have paid closer attention to the copybook.But instead, the test cases all passed. The software was, as far as the project managers and ETL developers could tell, working perfectly. So it was accepted, released to production, and running for a few weeks before the mainframe released its features. Those features then ruined all the beautiful reports with extraneous data.And since the ETL devs were on contract, any request to have them rework it under the original contract was met with a stern "Works as designed". Instead of paying the contractors to come back and rework the system, the mainframe devs instead were tasked with finding different padding fields they could use, padding fields which wouldn't end up ruining any reports management liked to see. [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!
Error'd: I Believe In Lingonberries
I've never been a huge fan of their furniture but I will happily demolish a plate of meatballs.Jan agrees "My loyalty to this Swedish megastore is immeasurable."
CodeSOD: Negative Days
Killian Brendel was looking through the .NET source code, and found this comment on the TimeSpan struct.
Representative Line: Something Wonderful
Today, we look at a "representative comment" from Mark W. This particular comment appears on a function:
CodeSOD: Convert Back, Way Back
Windows Presentation Foundation, the XML-based UI framework for Windows, has its own "fun" quirks. One of its core ideas is that controls can be data-bound: that text box is linked to a numeric field in your model class. Type a different number, and the model automagically updates.That's fine for what it is, but of course you're going to need to give it some instructions on how to do those kinds of conversions for your own custom types. And that's where the IValueConverter interface comes in.You can write a class which implements that interface, which can then Convert and ConvertBack. Which, as a note, I hate that naming convention; which way is "back"? Well, that's controlled via an annotation. This is some of Microsoft's sample code, from their docs:
The Hard Goodbye
One minute, you're fine. The next, you're doubled over with tears spilling down your face while an aching black hole in your heart threatens to drag you into oblivion.Grief's funny like that.Aggie Shaw, my old friend and mentor, had died of a sudden illness at home. She'd lived alone. Who found her? How? I didn't know and never would. There was so much I'd never gotten a chance to tell her. She would've listened to me vent the frustrations and resentments I'd been burying over the years for sanity's sake. She would've known what to do.God, I missed her.As if that weren't bad enough, the brass expected Tech Support to go right back to business as usual. Maybe the rest of them wanted to bury their heads in casework. I didn't. Between this, the horrible winter commute, and the promotion I'd never asked for, going back to the office felt impossible.My boss wouldn't let me use sick time. He really should've; the grief had hit me like a goddamn truck. Good thing the start of the new year a while back had refreshed my stack of paid time off. I started burning it from both ends.When I wasn't flat on my back or nursing a migraine, I was stumbling around my tiny apartment with half a brain cell, attending to the bare minimum of survival. Eat this. Drink that. Where'd I leave my smokes? In the rare times I could think, my thoughts were plagued with darkness. I didn't know if I'd ever make it out of that mess.Then, Megan called.It was nearing noon that day. I was lying in bed, peering out my window at a dull gray sky and falling snow. I'd let everything else dump to voicemail, but when she rang, I answered with the urgency of a drowning victim grabbing a buoy.Hey," she greeted, her voice subdued. I heard about what happened. I'm really sorry."There was so much tumbling through my head, but none of it wanted to tumble out. Thanks," I managed.How are you?"Lousy."Wanna meet up somewhere that isn't work?" she asked. The Apex Tower has a big indoor courtyard. I eat lunch there sometimes. If we go around 10 in the morning, we'd probably have it to ourselves."Something in me leapt at the offer. I'd like that. Tomorrow?" I would still be on vacation-in-name-only.Sure," Megan replied. See you then!"I had something to look forward to. Part of my emotional burden lifted right then and there.It was a little easier to get out of bed the next morning. I took the bus to an unfamiliar spot of downtown, crossed a slush-covered plaza, and entered a skyscraper. The warm ground-floor courtyard boasted marble floors and immense windows for walls. Potted trees and flowers lined the perimeter. Huh, I'd forgotten those even existed.Megan was already seated at a metal table flanked by two chairs. When she spotted me, she jumped to her feet and waved, a knowing and sympathetic look on her face. She waited until I reached the chair across from her to say, You look like you could use a hug."I froze with surprise, one hand on my hat in the process of removing it. A hug? My puzzled brain tried to figure out just when I'd been hugged last. I had no idea. My body wasn't waiting around for an answer. It was already turning toward her, arms raised.Megan silently walked into my embrace and hugged back firmly.Tears spilled down my face. My heart ached. And yet, another part of my invisible burden suddenly lifted. Something in me had been dying for this, for my pain to be seen.Thanks," I muttered.We parted. While I doffed my coat and hat, Megan returned to her chair, sitting back down across from me. Whatever you need to get off your chest, go for it," she offered.I sat myself down, sniffled, blotted my eyes on my sleeve, then glanced high and low to confirm something I already knew: we were alone in that big empty joint. Still, I hesitated. At first, I wasn't even sure I remembered how to string words together to form a sentence. But then it started gushing out of me like a busted water main. You ever hear of rubber-duck debugging?"Megan blinked. No."Surprising. Most developers had, but she was fresh out of college. A programmer came up with it way-back-when," I explained. Whenever you're coding something and get real stuck on a bug or error, you find yourself a rubber duck. Go line by line in your code and explain to the duck, out loud, what you want the code to do. Eventually, you and the duck will find the point where your intentions and reality don't match up."She smiled. I like that."Aggie had a rubber duck in her cube she called RD," I continued. Whenever she was stuck with a support issue or even a personal problem, didn't know where to go next, she'd tell RD about it. He'd help her figure out what to do or ask next.When I first got hired, Aggie showed me the ropes. She always said, the best way to troubleshoot is to be the duck yourself. Get people, or hardware, or software to explain what they're trying to do. You'll figure out how to proceed.Some people are so upset at the problem that they take it out on the nearest target: the support rep who comes to help. Aggie could charm even the angriest people into cooperating with her. She was the best. She was the best, and all she got for her trouble was more work. Now that she's no longer of any use to them, they've swept her under the rug. They want me to replace her!"Megan's eyes went wide.I'm no damn manager! I told my boss where to stick it. I'm riding out my PTO, and then hell if I know what's next. I can't go back there, I'd just be dying in place. And for what? So the bum at the top of the food chain can have a third yacht?" I leaned toward Megan, my gaze pleading with hers. Look, I ain't afraid of death. I'm afraid of dying before I've lived. I don't want my only contribution to the world to be reimaging laptops and rescuing old printers. I can't do it anymore. Can't sit around complaining, either, I gotta do something! I gotta get the hell outta that joint!"There it was: out in the open again, no longer whispered but shouted from the core of my being. Leaving was the right call for me. I felt it in my bones.Megan held eye contact, blinking a few times. I remember you saying you wanted to leave. If you did, what would you do?"I'd never really let myself play with my little pipe dream. I dunno exactly. But I've bought myself time to think it over. There are options, like going freelance."She blinked again. Freelance tech support?"I majored in Computer Science back in school," I said.Her eyes went wide again. Really?"Haven't flexed those muscles in a while, but I could. Or I could get into something totally different. And you could come with." Well aware of how unhappy she was at that joint, I sat up straighter in my chair. We could start our own IT group. No bosses. Everyone an equal partner with an equal say in how things are run. And we could rope in anyone else who wants to come with!"Megan seemed intrigued at first, but then sobered. What about bills? Rent? Everything?"We could pool our resources and look out for each other," I said. That'd give us some time to get our feet under us."Her expression turned strained. Aren't you scared?"You bet I'm scared!" I glanced down at the table. When I first got outta school, the idea of spending the whole rest of my life at a full-time job terrified me. But it seemed like everyone around me was fine with it. I thought I was the problem. Bit my lip, put my head down ... for 20 years." I glanced back up at her pleadingly. Has it gotten any better? No. I've just gotten used to it. Another 20 years, and I won't be any good for anything else. That's if I make it that long! Aggie didn't. Look, there's no right or wrong answer, just what's right for you. Listen to your gut. If you don't like where you're at, I'm living proof that staying the course is the wrong move. Leaving is risky ... but so's staying put, you know. The next round of layoffs could be right around the corner. You might get stuck babysitting that scheduling algorithm you were telling me about."Megan listened intently to my rant. Finally, she nodded. You're right. I'm not happy where I am, and it won't get any better. Time to try something different."Still mired in grief, I had at least gained a new sense of purpose to keep me afloat in the storm. Megan went back to work like nothing had happened. With my remaining time off from work, I did some research into our options. Hunting around online turned up a highly-rated accountant who walked me through the bare-minimum corporate setup, the taxes and bookkeeping and all that. We both tracked down advice online from other freelancers who'd been where we were now. And we put out feelers among our coworkers. Our questions struck some nerves, but also stirred considerable interest. Reynaldo was in; we had ourselves a network guy. Sanjay, a backend developer, was a maybe who wanted more time to think it over.There were plenty who wanted to join us badly, but couldn't swing it due to debt, insurance, things like that. I urged them to think about one thing they could improve at work, one cause they could get behind. Whatever it was, I told them to start making it happen, one step at a time.As my PTO bled away, I found myself half-exhilarated, half-scared outta my wits.Finally, it was time to go back. That first morning seemed like any other, but with my secret purpose in mind, I sat on the bus and walked the bone-chilling streets with a secret strength hardening my spine. When the old joint appeared ahead of me, more foe than friend, I felt relief knowing our remaining time together was short.Tech Support seemed no different; everyone was quietly minding their own business. I'd had plenty of time to think about what I'd do on the first day. My plan involved skipping my cube and heading straight to Aggie's old office. After my talk with Megan, I'd decided to go looking for something. I had a snowball's chance in hell of finding it, but something in me insisted on trying.As I walked up to the closed front door, the first thing I noticed was my name, not hers, standing out in fresh, gleaming gold letters against the frosted glass. Pushing past revulsion, I grasped the doorknob and turned it.The door gave way to darkness. I flipped the light switch with my other hand and found an empty desk, gutted shelves, bare walls. Looked like someone had come through with a giant trash can and thrown out whatever wasn't bolted down. My revulsion intensified, but hey, at least I wasn't trespassing. I shut the door to my" office behind me and slowly approached the desk.There was nothing to be found out in the open, not even a stray paperclip. I sat down hard in her old chair, reeling for a minute. Then I searched the desk drawers in front of me: first the bank on the left, then the right. Empty. I pulled out the drawer just under the desk-and there he was, swimming between a few stray pencils: a rubber duck about 3 inches tall. RD in the flesh.It was as if Aggie had put him there for me to find. I couldn't believe it. My spirits soared in a way they hadn't for ages.Just as I slipped the duck into my trench coat pocket, the door to her-my-office swung open again, making me freeze. There stood Bill, my boss.I saw the lights on in here." A smug smile spread over his face. I knew you'd be back. Bet it feels great, knowing you're done babysitting all those morons and their computer equipment!"Was that it? Twenty-odd years of my life boiled down into one cynical statement? No, there was more to it than that. For every bizarre war story, there were tales of grateful people helped, challenging problems solved. It hadn't been all bad. But it was over, just not the way Bill thought.An electric mix of nerves and resolve jolted me to my feet. I told you to find someone else, and I meant it. This is my two-week notice."I left Bill agape in that threshold and hurried back to my old cube, where my company-assigned laptop, docking station, and phone still resided. I hung up my coat, sank into my old chair, and booted up the machine. I had such a mountain of email in my inbox that I didn't even want to look at it, but there was one message at the top that I absolutely couldn't pry my eyes away from:
Error'd: The Song that Never Ends?
"Watch to the end", the scammers demand. In today's episode of Error'd, the end is a longtime coming.But at least it's amusing. In the meantime, Amazon irked and/or terrifiedthousands of their customers last week by mailing out ridiculously inflatedbills. It's been covered extensively elsewhere but why should we miss all the fun?It wasWilly who worried "Amazon prices seem to have crept up this month, financeare going to have something to say"
Classic WTF: My Many Girlfriends
Classic WTF: Server Room Fans and More Fun
CodeSOD: Classic WTF: Fork and Log
CodeSOD: Classic WTF: The Table Selector
Error'd: Princess Pricing
Sam suggests this Error'd indicates "Disney+ preparing the ground for usage-based billing." I'm intrigued by the idea that Disney might charge by the minute, but I suspect the reality is far more mundane.
CodeSOD: Wait Longer
Karen was maintaining some specification tests that were flaky. Not extremely flaky, but three or four times out of a thousand, the tests would just fail. The tests were complicated, and some of the operations were timing sensitive, so it wasn't precisely surprising- but the problem was that they were actually generous with their timing windows. The unit tests passed consistently, it was only these functional, specification-based tests that failed.So, for example, there were sections in the tests where they wanted to wait at least 2ms. Since the code and tests were in TypeScript, they used the setTimeout function, which per standard JavaScript documentation warns that it may wait longer. But again, Karen was fine with longer.Unfortunately for Karen, the documentation for NodeJS is less specific, as it makes no guarantees about when the timeout function gets invoked. This means that it can fire the timeout before the time has elapsed.After many, many hours of debugging, that was exactly the situation that Karen found herself in. Which is why her very simple wait function went from:
CodeSOD: The Error Check
Today's submission is less a WTF and more a, "Yeah, that'd annoy me too."Stevie works in a code-base that's largely C, which means function return values are usually used to communicate to status codes. The standard:
CodeSOD: AAYFN
Jason M sends us some Ruby code.
The Easy No
Error'd: Einfach so
Do you say "a FAQ" or "an eff eh cue"? Peter says eff eh cue I think."This is a test"Peter G. harrumphed testily."Create an FAQ with exactly nine entries. Nine? Nine."
Flushed Out
While a project manager is frequently called upon for their planning ability, the real skill we want from project managers is their ability to communicate. The job of a project manager is to align the team doing the work, with the organization goals driving the work, with the management and leadership teams trying to understand the work, while juggling all the constraints like budgets, timelines, and the endlessly changing expectations for the project. A good project manager is worth their weight in gold. A bad one will cost their weight in gold.Mark was hired on as a contractor, reporting to Tegan. Tegan was fresh out of business school, complete with an MBA and a variety of project-management training certifications. Unfortunately for Mark and the rest of the team, and especially unfortunately for Tegan, she had absolutely no real world experience. To make matters worse, this wasn't just a software project: they were working on a system which matched newly developed software with newly designed mechanics and custom build control electronics. A group of experienced software engineers, mechanical engineers, and electrical engineers all found themselves reporting to a bright and shiny MBA. It's a role that she probably could have grown into, but management saw all the acronyms she continuously put after her name, and decided she could just take the whole thing over with no real guidance.It went badly pretty much from the beginning. Tegan was not a talented communicator. For example, Mark's team needed to know: on what timeline were the electrical engineers going to deliver the first prototypes, so the software team could start running bench tests of their software? Tegan's response was a fortune cookie message about balancing the complicated pipelines and lanes on the Gantt chart and hitting all of their milestones; like a fortune cookie, it was vague, important sounding, but ultimately empty.Of course, the natural reaction amongst the engineers was to just route around the damage: the various teams could talk to each other just fine without going through Tegan. That, unfortunately, did not go over well with management. Tegan, as the project manager, was their insight into the project. They needed her in the loop on everything. And she couldn't just be informed, she had an MBA. She needed to be making decisions. But she was unqualified to make those decisions, which meant the project gradually ground to a halt. Tegan's emails got more vague, her meetings got longer but accomplished less, and after a certain point, she just stopped replying to key email threads.The first few days of radio silence seemed like a gift. But as time passed and Tegan seemed uninterested or unable to reply to any of the questions the team had for her, the project started to flounder. The engineering teams escalated this problem to management. Management presumably went back to Tegan. At some point, feeling the weight of everything going wrong around her, Tegan sent out this email, which is definitely the best and clearest communication she managed during the project. It's arguably the clearest, and most accurate communication one could make in this situation:
CodeSOD: Module Test
TJ inherited a NestJS project. The original developers left the team many years ago, but they've left their mark in the codebase.
CodeSOD: On Hold
"Dragoncoder" supports a web application that has a "wait time" for access. I hate that that's a thing, but I recognize that there are real-world constraints where this might make sense. Still, I hate it. But that's not the WTF.
Best of…: Classic WTF: Difficult Personality
Error'd: Kaids Hen 2025
On the recurring transportbeat, this week brings us a handful of wtfs relating tomass transit. Nothing private."Thank you for traveling with Deutsche Bahn" sneers Philipp H. bitterly, explaining "The German railroad company sadly is famous for often beinglate and also has lots of other issues. While bookingmy next trip I'm asked to pick my seats forthe reservation. - Looks like they now stack seats oneach other or on the table. - hopefully the seatsfacing the wall at least have a window there. -winning the jackpot lottery also seems more likely than understandingtheir seat numbering system."
CodeSOD: The Most Dangerous Game
While we talk about bad video game code periodically, we generally avoid it because it's so specialized and while something like fast inverse square root is bad code from a maintainability perspective, it's great code for abusing floating points to make math fast.Itan Yldz sends us a snippet from a game's config file. I won't pick on the specific game, but this isn't some random build of TuxCart, but a released game sold on multiple platforms. It's from a small team, but it's an actual professional product running on many devices. What's notable about this is the game has multiplayer elements, which means networking code, which means...
Representative Line: A Specific Key
Today's anonymous submission isn't really a WTF, but it highlights the hardest problem in computer science: naming things.For example, let's say you saw a method called handleRSAPrivateKeyGeneration. You'd likely assume that it generates an RSA private key. More specifically, it accepts a request for a private key and handles that request. It's right there in the name.
The Hot Fix
CodeSOD: Off the Path
File path separators are a common pain point when writing cross platform software. Of course, not every programming language has a graceful API for handling that. For example, prior to C++ 17, you had to do some #ifdef preprocessor magic to handle that. Which people usually did (or they'd use the Boost suite of libraries).Code like this wouldn't be out of place or incorrect:
Error'd: Fi fa foe
First up this week is a little story about a fifafail. I do wonder if this was a failure of the television station, or whether there was something more to it than that.Hercules wrote to alert us to these World Cup shenanigans, explaing "At least the flags were correct. And yes, this waslive TV. The host got the country names correctly, andeven called out that the written text was wrong"
12345678910...