Feed the-daily-wtf The Daily WTF

Favorite IconThe Daily WTF

Link http://thedailywtf.com/
Feed http://syndication.thedailywtf.com/TheDailyWtf
Updated 2024-04-28 07:02
Error'd: Mirror mirror
An abstitution, an assortment, time travel, bad language, and an error'd.First up,Jeremy Pereira pushes the boundaries of this column by sharing something right."Sort of an anti-WTF. It took them 44 minutes to realise they'd made a boo-boo."They probably were notified, but it's still pretty goodtime to repair. Especially considering the issues we knowof that last for years and years.
CodeSOD: While Nothing
Jose received a bit of VB .Net UI code that left him scratching his head.
A Stalled Upgrade
It was time to start developing version 2 of Initech's flagship software product. This meant planning meetings. So many planning meetings.The most important one, for the actual development team, was the user story meeting. The core of these meetings was a few folks from the programming team, including Steve, the director of architecture, Brian, and a variety of product owners, responsible for different segments of the overall product.As a group, they'd review the user stories, and approve them. Once they were approved for development, work would begin.The meetings were difficult to schedule, because of the number of stakeholders, and they were viewed as a checkpoint- you can't start implementing features until the product owner has walked through the user story with the team, but they were also a priority.At the meeting, product owner Renee started walking the team through some of the features she owned. "So, here's my user, Fred Flinstone." Her slide popped up an image of the animated character next to a set of bullet points describing the feature. "He needs to add an item into inventory, so that it can actually be sold. To do that..."Renee walked them through the details of the feature. Heads nodded around the table- it was a pretty straightforward CRUD application. It was good that the product owner walked them through a few workflow things unique to Initech's product, but there wasn't anything particularly shocking.Renee advanced to the next slide. "And now, Fred needs to run a report. This report needs to..."Again, Renee walked them through the key fields that needed to be on the report, how the report was triggered, what the reasonable filtering options would be."Any questions?"Brian, the director, looked thoughtful for a moment, and then said, "I think I do. I can't really see a reason why one person would want to both add items to inventory- a receiving job- and run reports on inventory consumption. There's no reason someone doing the task would also need to run the report. I can't accept your user stories until you change one of the users to be a different person.""What? The name doesn't matter," Renee protested."We should probably just stick a pin in this and pick up when we can reschedule another meeting. Thank you everyone," Brian said. He grabbed his laptop, stood, and left the meeting. Everyone sat there for a moment, realized the meeting was actually over, and followed him out a few minutes later.That afternoon, Steve finally managed to find Brian. "What the heck was that?"Brian sighed. "Look, the entire development team is swamped, you know it. We don't have bandwidth to take on new work. Tracey should have that priority-one bug done in a few days, and maybe once that's done we can start putting resources on the the version 2 project. For now, we need to stall, and that was the only thing I could think of." [Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.
Representative Line: A Memory of Strings
As we saw yesterday, padding can be hard.Jasmine received a set of tickets all complaining that the file download portion of an ASP .Net application took too long. Users frequently had to wait for up to 15 minutes before their browser finished downloading the output of the web application.This particular module generated the file by doing a set of Response.Writes to build the file as part of the HTTP response. This particular line ran 200,000 times in the process of creating the file:
CodeSOD: Timestamped File Name
It's been a minute since some bad date handling code. Wesley inherited this C# blob which exists to generate timestamped filenames.
Error'd: ROUS
I don't think they exist.ChoosyChris P. wants more choices, carping "You keep using that word, I don't think it means what you think it means."
A Bit About the HP3000
Today's anonymously submitted story is a case where the WTF isn't the code itself, per se. This arguably could be a CodeSOD, and we'll get to the code, but there's so much more to the story.Our submitter, let's call them Janice, used to work for a financial institution with a slew of legacy systems. One such system was an HP3000 minicomputer. "Mini", of course, meant "refrigerator sized".The HP3000 itself is an interesting, if peripheral story, because it's one of the tales of a product launch going incredibly wrong. Let's talk a little history.We start with the HP2100 in 1966, which Hewlett Packard did nothing to design, and instead purchased the company that designed it. The core innovation of the HP2100 was that it was architecturally similar to a PDP-8, but supported full 16-bit memory, instead of PDP's 12-bit.HP didn't really know what they had bought- they marketed it as a "test and instrumentation" system, and were surprised when businesses purchased it for back office operations. They ended up with one of the most popular minicomputers for office use, despite it not being designed for that purpose.Thus began the projects "Alpha" and "Omega". Alpha was a hardware refresh of the 2100, with a better memory model. Omega was a ground-up redesign for 32-bit memory, which would allow it to support a whopping 4MB of RAM. There was just one problem with the Omega design: they didn't have funding to actually finish it. The project was killed in 1970, which threw some of the staff into "wear black armbands to work" levels of mourning.Unfortunately, while work was done on Omega, the scope of Alpha crept, which resulted in another project management wasn't sure could be delivered. But the market was there for a time-sharing minicomputer, so they pressed on despite the concerns.The HP2000-line had time sharing system that used multiple processors. There was a front-end processor which handled user interactions. Then there was the actual CPU, which ran programs. This meant that time-sharing was simplified- the CPU just ran programs in a round-robin fashion, and didn't have to worry about pesky things like user inputs. Essentially, it was really just a batch processing system with a multi-user front-end.The designers of Alpha wanted to support full multiprogramming, instead of this hybrid-ish model. But they also needed to support traditional batch processing, as well as real-time execution. So the team split up to build the components of the "Multi-Programming Executive" module, which would allow all of these features.The Alpha, which was still 16-bit, didn't have the luxurious 4MB of RAM- it had 128kB. The MPE used much more memory than 128kB. This led to a massive crunch as the programmers worked to shrink MPE into something usable, while marketing looked at the deadlines and said, "We were supposed to be selling this thing months ago!"The result was a massive war between engineering and marketing, where marketing gave customers promises about what the performance would be, engineering told marketing what the actual performance would be (significantly worse than what marketing was promising), and then management would demand engineering "prove" that marketing's over-promises could be met.The initial ship-date was November, 1972, and by god, they shipped on time. Nothing actually worked, but they shipped. The first computer out the door was returned almost immediately. It could only handle two simultaneous users before slowing to a crawl, and crashed every ten minutes. By December, HP had gotten that to "crashes every two hours". They kept shipping machines even as they had to cut features and reliability promises.Those frequent crashes also concealed another bug: after running for 24 days, the HP3000's clock would overflow (2^31 milliseconds) and the clock would magically reverse by 25 days. As one sysop of a purchased HP3000 put it: "The original designers of MPE never thought the OS would stay up for 25+ days in a row".After a bunch of management shuffling, the titular Packard of Hewlett Packard sent a memo: production was stopping and all sold computers were being recalled. Customers were offered HP2000s in its place, or they could wait until fall 1973 for a revised version- that would only support 4-6 users, far fewer than marketing's initial promises of 64. This pleased no one, and it's reported that some customers cried over the disappointment.With sales paused, the entire computer underwent a design overhaul. The resulting machine was faster and cheaper and could actually handle 8 simultaneous users. One year after the botched launch, the HP3000 went back on the market, and ended up being a full success.It was so successful, HP continued supporting the HP3000 until 2010, which is where Janice enters our story. Circa 2006, she needed to update some Pascal code. That code used a lot of bit-masks to handle flags, which is normally a pretty easy function in Pascal- the language has a standard set of bitwise operations. So Janice was surprised to see:
CodeSOD: Return Country
Let's say you have a database table containing a list of countries. Given the primary key of a country in that table- an arbitrary ID field- you need to look up the name of that country.Curtis's predecessor dropped this solution:
CodeSOD: Max Character Width
One of the "features" of the Oracle database is that, in addition to the "wonderful" PL/SQL language for building stored procedures, you can also write stored procedures in Java.Now, the skills of "being a good database programmer" and "being a good Java programmer" are not necessarily overlapping, especially when you're deep in the world of Oracle's approach to programming. Which is where this submission, from Tomas comes from.
A Laboratory Upgrade
Unfortunately for Elena, the laboratory information management system (LIMS) her team used was being sunsetted by the vendor, Initech. She's a biochemist working in a pathology department, and this software is vital to tracking the tests need, the tests already run, and providing critical notifications about abnormal test results.Since Initech was sunsetting that product, the hospital system put out an RFQ for a replacements, and after a multi-year bidding process, offered the contract for replacing the software to Initech.And thus, IniLab went away, and was replaced by IniHeal. Gone was the classic terminal interface that everyone had learned to use, and in its place was a "user friendly" GUI- a GUI that buried functionality behind fifteen clicks, had no meaningful keyboard shortcuts, and was constantly changing as they pushed updates, making it impossible to adjust to.Also gone was the IniLab scripting language. IniLab's scripting language was how they had assembled workflows for laboratory processes. You could have fine grained control of which scripts tied to which kinds of tests, and even build custom workflows as one-offs, if necessary. They had many thousands of lines of code that needed to be ported over into IniHeal. The problem was IniHeal's approach to scripting was... well, bad.First, IniHeal doesn't allow you write scripts. Instead, it has a pair of "rule" files. The marketing copy calls these "declarative", and promises that they're an upgrade. In practice, these are gigantic files that contain a set of rules that are evaluated for every test and every sample.But the worse problem in IniHeal is how it lets you handle data. In IniLab, if you wanted the patient's age, you might reference the field by name: Patient.age. In IniLab, you need to use the PPPPLL. What is the PPPPLL?PPPPLL stands for "position" and "length". Instead of referencing a field by name, you have to reference the field by its byte offset and length. So Patient.age might be [091001]. And no, there's no easy way to create constants or variables to hold your PPPPLLs, you just have to know that [091001] is age, and hope that the input data never changes its layout.Now, one of the things Elena noticed while techs were on-site is that the length of the date time fields was 32 bits, and the data was seconds since the Unix epoch. So she asked one of the senior developers "Hey, is this software Year 2038 safe?"The developer laughed. "I'll be retired by then."The final insult to injury is that this software wasn't installed on any laboratory workstations. Instead, they had to use Remote Desktop to access it inside of a VM. While the environment was theoretically locked down so that the only program you could run was IniHeal, in practice it was trivially easy to get to a desktop inside the VM.Curious, Elena poked around. She not only found the installation logs from her lab's deployment, but the installation logs from several other labs. These logs included various internal and private details, including account passwords. Somehow, log files from client installs had ended up in their installation media and were deployed to every client site.Elena reported the potential data breach. The final finding was that the password in question was long defunct, which led management to decide "well, that's no problem then."IniHeal has a slogan about equipping customers with innovative tools, but Elena proposes a new one:"The Q in IniHeal is for Quality." [Advertisement] ProGet's got you covered with security and access controls on your NuGet feeds. Learn more.
Error'd: Groundhog Day
In this week's episode we have some moreadventures in shipping and misadventures with dates.I justasked "Hey Google, how many days are therein February THIS year" and they answered confidently "28 days."I briefly considered autoplaying that query on this page to seehow many of your devices would answer correctly, but then Idecided I should autoplay a command to order me a pizza andthen I thought better of the whole thing.Following up on an earlier submission,Dave P. reports"Much to my amazement, the package did arrive in time for Christmas, but just barely. USPS really came through on their end, taking less than 2 days to deliver the package,after the original delivery service took 12 days to find the USPS dropoff facility."Hah! Somebody owes me a nickel!
CodeSOD: A Well Known Address
Amanda's company wanted to restrict access to a service by filtering on the requestor's IP address. Yes, this is a terrible idea. So they wanted to make it a bit smarter, and also filter on various subnets. But they had a LOT of different subnets.So the result was this:
CodeSOD: A Voice Map
Let's say your company wanted to offer special deals. When a customer calls about one of these deals, you want to play an automated customer support message using SignalWire, a tool for scripting phone voice trees.This is a natural case for using a Map data structure. Which is what Ajay's predecessor did. They just... uh... weren't sure how to use a Map.
CodeSOD: 2019 Was a Fine Year
Efren's employer recently acquired a competitor. The competitor had been struggling for a number of years, and the acquisition was a last ditch attempt to preserve at least some of the business (a complete closure was the only other option).Now, "struggling for a number of years" sounds fairly vague, but due to some bad database design, we actually have a clear indicator of exactly when the company gave up:
CodeSOD: Bent Struts
Luke has inherited a Java Struts-based application. Struts is one of the many Java web frameworks, designed around having HTTP requests trigger actions- that is routing HTTP requests to a specific function call.Now, on one screen, the user filled in a form, and then the corresponding action on the server side needed to read the form data for an eventId and act upon it. In Struts, this can be very simple:
Error'd: Ride Ride Ride
File under "Old Business": Swissrail just can't catch a break.Diligent Richard B. dug into the news and reports"After following the link from this week's Error'd, I cameacross this interesting description in Swissrail's Member list.The filename means 'Company description En(glish)'.They have the same thing in French; the German description is normal."
CodeSOD: Control Tree
User interfaces tend to map fairly naturally to trees as a data structure. In the modern world where we've forgotten how to make native UIs and do everything as web applications pretending to be native, the "tree" model is explicit via the DOM. But even in native UIs, we tend to group controls into containers and panels and tabs.Now, there may be cases where we need to traverse the tree, and trees present us with a very natural way to traverse them- recursion. To search the tree, first search the subtree. Recursion can have its own problems, but the UI tree of a native application is rarely deep enough for those problems to be an issue.Nick inherited some VB .Net code that iterates across all the controls in the screen. It does not use recursion, which isn't a problem in and of itself. Every other choice in the code is the problem.
CodeSOD: Replacing a City
Mateus inherited some code where half the variables were named things like strAux1 and strAux2. It was a data driven application, and the data had some conventions that weren't always ideal; for example, every city also had an associated abbreviation stored in its name field, e.g., "SAO PAULO (SP)" and "RIO DE JANEIRO (RJ)".The original developers wanted to be able to present the names of cities without the abbreviation, so they wrote this:
CodeSOD: Name a Valid Email
Correctly validating an email address, per the spec, is actually surprisingly hard. This is, in part, because there are a lot of features in the email address that nobody ever uses. Even so, you can easily get close enough with basic regex, and that's what most people do.Niels H's predecessor wanted to go a little farther. They wanted to ensure that the supplied domain name had a valid DNS entry. Overkill? Probably. But, fortunately for them the .NET framework supplies a handy System.Net.Dns.GetHostEntry method, which resolves a domain name. That at least makes the problem easy to solve.It makes the problem easy to solve if you use it. But why use a built in method when you can do it yourself?
CodeSOD: Pretty POed
"QPirate" was debugging an issue with purchase order version information. The format was supposed to be "Revision#.Version#", essentially "major" and "minor" versions for the various steps as the purchase order wormed its way through the company's incredibly complicated purchasing process.Unfortunately, that isn't what was happening. Many numbers behaved in unexpected ways when they were versioned too many times. QPirate dug in, and found this:
Error'd: Grasshopper
One of my multitude of peeves is the phrase "special characters." Somehow,our lexicon has been corrupted by semiliterate middle-schoolers,who have never learned that the name for ,.;: and so on ispunctuation and/or symbol. Dustin Hoffman's Raymondwas a special character. Period ain't.This week,Robert F. had the misfortunate to step into it, and observed "What boggles my mind is that someone had to activelychoose to create a validation rule specifically for this."
CodeSOD: Get Results as What?
Before RESTful web services and JSON as a serialization format, XML was going to conquer the world. Circa 2001, I remember going to user's groups only to hear about how XML was going to allow legacy mainframes to be connected to modern applications (without discussing the fact that the legacy mainframe still needed maintenance and code support). These days, XML is (nearly) dead, and lighter-weight markup languages have replaced it, including JSON.Which brings us to this method, from Chris:
A Continental Divide
Our friend Argle has shared a great many stories with us. Today's story is one that Argle relates secondhand, about one of Argle's former students: Marie.Marie was a prized student, and kept in touch with Argle after classes. At various points, they were co-workers at other companies, or when Argle founded his startup, Marie was one of the first hires. In between those points where their career paths converged, they kept in touch, even visiting each other at work.For a few years, Marie ended up in Initech's telecom division. Her office was not in the traditional cube farm, but a small room (with a door and everything!) buried in the basement, far from windows. It may have been a bit of a dank, ugly, cave, but Marie, like all of her fellow Morlocks, did what she could to make it more homey.Given the era, and the specific computer-nerd subculture, that meant a lot of the ThinkGeek-style desk toys and posters. A Netwon's cradle over there, a fossilized shark's tooth there, and on the wall a Firefly poster sandwiched between a "Reunite Gondwonaland" poster and a "Pangean Liberation Front" poster. It wasn't much, but it was a home away from home.For months, everything was happy, or as happy as one can be in a basement cave in at Initech. At some point, a new manager was hired, took a tour of the basement, introduced himself, and shook everybody's hand. Well, everybody's hand but Marie's.Later that day, when she popped out of the Underdark to forage for lunch at the taco place down the street, she saw the new manager huddled up with the older managers, whispering to themselves around the coffee maker. When she passed by, they clammed up until she was back out of ear shot.When Marie returned to her desk, there was an email waiting for her- she was to report to the office of her Two Levels Up boss immediately. That couldn't be good. She dutifully trudged to that office. That triggered a call for all the other implicated managers on the team, and before long a half dozen people were crammed into this single office with stern looks on their faces."It's come to our attention that you've been displaying... inappropriate items in your office." "Flagrantly!" "Potentially offensive!" "Inappropriate for work, certainly, but also inappropriate for anywhere else!" "Blatantly political items are inappropriate for company owned spaces."The managers, in chorus, explained to her letter and verse exactly which sections of the employee manual she had violated, and exactly what those consequences were going to be. What they didn't explain was how exactly she had violated them."I'm confused, what items am I displaying that are blatantly political?""Why, those posters!" New Manager said. "Not just blatantly political, but also offensive to many of your co-workers."Marie was aware that Firefly's cancellation had been cause for much outcry amongst its fans, but didn't see how that was political- and then she realized that it was the other two posters: "Reunite Gondwonaland" and "Pangean Liberation Front" that had drawn their ire.Marie could have, at that point, defended herself. She could have explained the joke (which always makes it funnier), and attempted to explain geology and continental drift to a horde of managers that had already worked themselves into a frenzy over things they didn't understand. And while she would have been right, it certainly wouldn't have won her anything, and would likely have made the situation worse.So instead, she said, "Oh, I'm sorry, I didn't realize. I'll take them down." After a little more scolding, she was released to go back to her cave, where she did what she promised, packing the posters neatly into the original packing tubes they'd come in. And after that, she touched up her resume- it wasn't going to be hard to find a place where she could express herself "politically". [Advertisement] Continuously monitor your servers for configuration changes, and report when there's configuration drift. Get started with Otter today!
CodeSOD: Clear This
Andy found this simple function in a C project he's working on.
CodeSOD: A Simple List Copy
Mike's team had a new hire. They did great on the interview, really shined in the coding challenges, so it was a no-brainer hire. In the middle of on-boarding, the team got slammed, so this new hire ended up being left to fend for themselves.This was a mistake.
Error'd: Patience
Surprise-hating Adam R. worries"I thought I ordered some outdoors gear, but apparentlyI'm receiving some not valid today. I hope I don't geta box full of surprises!" I get it Adam; I don't likesurprises either. But they're better than spiders.
CodeSOD: The End of Time
We often talk about dates and timekeeping as extraordinarily difficult tasks. And, at least in part, that may have to do with their origins as legacy technologies in the most legacy sense: we have strong evidence of calendar systems all the way back into the Neolithic period, and maybe some hints of them as far back as the Paleolithic. Literally, stone age technology, still in use today.I wonder if that's why calendar's hold such a mystical hold over us? Many of us likely remember the New Age predictions that 2012 was going to mark the end of the world or some great reconfiguration of the world, simply because it marked the end of a cycle in the Mayan Calendar. Before that, prophecies centered on the year 2000, not just because of the Y2K bug, but simply because it's a round number and people felt like that's a good place to call it. Before that, there was the astrological predictions of the Age of Aquarius (which may fall anywhere from 1844 to sometime in the 24th century, but was real popular for a minute in the 60s and 70s). And we can walk farther back into history, finding eschatological predictions centered around significant dates.Will some future society see the Y2K38 bug as a similar marker of the End TimesTM? And when that passes, will they turn to this prediction, found in Etienne's codebase?
Contracting: Enterprise Edition
After a move to another city, Philip found himself looking for work. Fortunately, a contract came his way. The money was good, the customer was a large bank. At the time, Philip's only regret was that it was a 6-month contract- something longer would have helped him get settled in his new home.The first week of those six months were spent waiting for the operations team to provision him a Citrix environment- developers weren't given laptops, they were given dumb terminals that connected to a canonical dev environment hosted in Citrix. So, for one week, Philip did nothing but sit at a desk for 8 hours. He didn't have a laptop, and as a bank they had strict rules about personal devices being used, so he couldn't even use his phone.Once Philip had an environment, he was able to start looking at the code. He knew he had signed up to work in a Java shop, but was quite surprised to discover it was a J2EE shop. Starting in 2006, J2EE became Java EE, which eventually became Jakarta EE. But this project started in 2015, well past J2EE's expiration date. "Do I have the right code?" he asked, wondering if he had pulled the wrong version or the wrong product or something."Nope, that's it," one of his new co-workers replied."Ah, so, uh... where are the tests? That'll help be learn the codebase?"The new co-worker blanched and turned straight back to their computer. Barry, Philip's new manager, tapped Philip on his shoulder. "Why don't you come with me?"Barry lead Philip to his office, where another manager was already waiting. "Who told you that you could write tests?" Barry glowered at Philip, while Philip tried to parse that question. Who had told Philip he could write tests? Common sense? Basic programming practices?"You're a developer," Barry explained, "and we're paying you a not insignificant amount of money to be a developer. If we wanted you to be a tester, we'd have hired a tester. Use your time here responsibly, and maybe this contract can become a temp-to-hire. Now get back to work. Get back to developing."The dev environment in Citrix didn't have the J2EE container installed- they used WebSphere- so Philip had no way to actually run his code. It took another two weeks to get permissions to install the required software, and their copy of WebSphere was distributed as a zip file stored on a shared network drive.A month into his 6 month contract, Philip was finally able to pick up a ticket, do some work, and see the results.And then Barry pulled him into another meeting: "Why do we have a copy of WebSphere in Citrix now? There's a test server, you're just supposed to put your code there.""There's a dozen developers, and one test server.""And?" Barry asked, impatiently. "Just take turns. We're going to reset your Citrix environment, and don't do that again."At the end of Philip's six month contract, he was not offered an extension or an option for full time employment. He was just glad it was only six months, and made a note to never work for that company ever again. [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!
CodeSOD: Exceptionally Backwards
"Generic exception handlers" sound like an oxymoron, but are a weirdly common pattern in web development. ASP .NET, for example, has a global.asax file, which can contain an Application_Error method. In practice, this is meant to handle all the otherwise unhandleable errors- each individual endpoint should still do exception handling for all the errors it can, but the errors that are impractical to handle locally, like the database being inaccessible, bubble up to your generic handler.Of course, it's important that the generic handler actually handle the exception. Which brings us to George's submission, an ASP .Net error handler.
CodeSOD: The Chosen Solution
Error'd: One If By Land
It's a new year, but Error'd never changes. Still (mostly) thesame contributors, still the same reliable return of NaNs,nulls, out of sorts sorts, bad date math, and a slavishadherence to the Oxford comma and two spaces after periods.MFC (Most Faithful Contributor)Michael R. sings "Love remains even after the event is over at Tixel."
CodeSOD: Just One Check
Christian works on an application that has some unusual conventions. For example, while I've seen many a codebase that Hungarians their private member variables like _myPrivateMember, his team did the opposite: myPrivateMember_.Someone on the team had a problem: they needed to verify that at least one checkbox was checked. This was their solution to that, in C#:
CodeSOD: A Type of HPC
Matteo's company hired a Highly Paid Consultant. The HPC came in, took one look at their C# codebase, and said, "You're doing everything wrong. But don't worry, I can fix it!"So he "fixed" it.For example, what if you had a string, and needed to parse it to some concrete type. Why, you just do this:
CodeSOD: Making the Thingie Work
Alyssa inherited some code from... well, she isn't entirely sure from whom. There are names that come up in git blame, but even for some more recent commits, Alyssa has no idea who they are. Contractors? Interns? Randos pulled in off the street and handed a keyboard?Based on the code quality, the last option is surprisingly likely.
Best of…: Best of 2023: A Single Bug
Error'd: Shippingship
Unpacking from the pre-Christmas rush, as you might imagine our readers were running intoall kind of fun with packages and delivery and time warps. But first, proof that time warpsalso afflict even web sites that ship only bits, not boxes.Jonathan B.wondered "What day IS it today?" when faced with this article.
Best of…: Best of 2023: Modular Dependencies
Best of…: Best of 2023: Around the World (Around the World)
Best of…: Best of 2023: The Microservice Migration
Christmas in the Server Room
It's the Holiday Season, so we're going to take a break from our usual content, and talk about holiday movies and TV specials. But we can't just completely abandon what The Daily WTF is about, so we're going to rate these holiday classics for the accuracy of their portrayal of the IT industry. We'll rate each on a scale of 5 floppy disks, where 5 has the documentary accuracy of Office Space.A Charlie Brown ChristmasThe story of A Charlie Brown Christmas focuses on the conflict between Christmas spirit and commercialism. The story contains no computers or IT professionals, and instead focuses on the annual Christmas play which the children are producing. In that regard, it's a story of a poorly scoped, poorly resourced project, with the actual responsibility for the project's success being left in the hands of unqualified children, while any sort of managerial oversight by adults is expressed as sad trombone noises.Wha wha whaaaa, indeed.Rating:A Miracle on 34th StreetKris Kringle, a department store Santa claims to be the real thing. He's committed to a mental institution, triggering a court case to determine whether he's dangerously insane- or actually Santa Claus. The "twist", such as it is, is that the Post Office, overwhelmed with all the letters to Santa, decides to deliver the mail to the courthouse. By this, it's determined that the Federal government, in the form of the postal service, believes Kringle to be the real Santa Claus. The case is dismissed, and Christmas is saved.Again, there's very little technology in this story, but the postal workers thinking they have an easy solution to a hard problem and literally dumping it in someone else's lap is very relatable.Rating:Rudolph the Red Nosed ReindeerRudolph, assumed to be "defective" because of his glowing nose, goes on an adventure with other "misfits", until his difference is suddenly useful: his glowing nose will guide Santa's sleigh through the snow. The moral of the story is that it's okay to be different- so long as you're useful.This tale is the tale of the overeager intern, the one who wants to do the "real" work, and is overjoyed to be asked to work late on Christmas Eve, because they finally feel like an important member of the team. Painful watching, but sadly true to life.Rating:Die HardVacationing police officer John McClane's holiday reunion with his estranged wife goes off the rails when terrorists take over the building. But they're not terrorists- they're thieves, and this is all a stunt to get them access to the building's vault.Central to this plot is that, to bypass the final lock, the thieves need the FBI to cut power to the building. From a "basic common sense" perspective, this is absurd- of course you'd expected a powered lock to fail safe, not fail open. That said, we've seen so many wiring and electrical snafus on this site, that I have to grant it some plausibility. Bonus points for the sleazy sales-beast dying. Not realistic, but satisfying.Rating:Santa Claus Conquers the MartiansThe Martian children are sad, so their Martian dad decides to kidnap Santa Claus. This creates a factional schism in Martian culture between the Santa-loving progressive faction, and the conservatives. The conflict is resolved when the dumbest Martian- named Droppo- decides to become Mars's Santa Claus, and Santa is sent home.The movie is stuffed with robots, spaceships, pills instead of food, and of course the requisite 50s era "pushbutton future" where instead of making toys, Santa just pushes buttons on a Martian machine to generate them. It's profoundly dumb, but not as dumb as Droppo. That said, the dumbest person on the planet being handed a powerful position with basically no responsibility and answerable to no one? Painfully realistic.Rating:A Fairytale of New York"It's Christmas Eve dear, in the drunk tank," begins this dark Christmas song. From there, we hear a couple fighting over their broken dreams, and broken hearts, with real genuine spite for each other.Yes, we're drifting out of visual media and into song. While nothing about this may seem terribly IT related, we can see through the subtext of the song. Arrested for public intoxication on Christmas Eve, living a life of wrecked and shattered dreams? Clearly, this is a story of someone who foolishly agreed to push a new release on Christmas Eve. "The tests passed, what could go wrong dear?" might as well be a line in the song.Rating:Jurassic ParkThree wise sages are called to attend a series of virgin births- the births of dinosaurs. While this Christmas movie breaks with tradition by not happening around the Christmas season, and not featuring any Christmas traditions, the characters of Malcolm, Satler, and Grant are clearly following the star to a velociraptor infested Bethlehem.That this entire automated park has one IT professional, and that this IT professional is disgruntled, underpaid, and no one in management seems to care? Said IT professional has all the keys to the kingdom and can do anything he wants with the infrastructure, because management is entirely absent and incompetent? This movie is practically a documentary.Rating: [Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.
Error'd: I Sleigh Me
Counting down to the end of the year, in prep for someholiday or other, here are your penultimate five Error'dsfor 2023. I wonder if Debbie ever was a real person.First, Dr. Drk S. has some odd network behavior to share."Sometimes inexplicable things happen in the cloud. Sometimesyou get alerts that just go away. Sometimes you detect curiousnetwork traffic patterns. Sometimes it all averages out to nothing."
Radical Pricing
Genesis stepped off the bus, splashing through puddles in neon-yellow rain boots, towards the old, rusted bay door of the "Radical Radiators" building. Her actual employer was "Radiation Programmers", which was either related to the heating company or had purchased the building cheap when the radiators went out of business.Key in hand, she unlocked the door, walked past the "No Smoking" sign, and settled in beneath the buzzing fluorescent lights. Laptop on wi-fi, NPR murmuring in her headphones, Genesis settled in for her day: writing software to handle payment processing for fan fiction sites.The garage creaked open. Ten seconds later, a man with a gray, frayed beard ambled in, his blaring music audible even through Genesis's noise-cancelling headphones."Hey Howard, how was your commute?" Howard grunted in reply. Their interactions were minimal, consisting mainly of morning nods and grunts. Genesis was replacing Howard on the team, and it wasn't clear to her if Howard was on his way to a new job or was getting fired and training his replacement.Howard made a bee-line for the ancient coffee machine tucked in the corner. After concocting a brew, he settled at his desk amidst a litter of candy wrappers, soda bottles, and a sandwich from yesterday's lunch, grunting as he sat down.Genesis checked the time, and realized she had an impending 8:45AM meeting with the CEO, Alexis, or as she preferred to be called, "Alexa". There was no agenda, so she opted for coffee and settled into the makeshift conference room, once a car repair garage's back office.Alexa arrived late, Starbucks in hand. "Sorry, let's meet in my office."Once in the office, Alexa set the Starbucks cup down, and grabbed an energy drink from the mini-fridge and some ibuprofen from her desk."So, there's no agenda for this meeting," Genesis said.Alexa downed the pills and chased them with the entire energy drink. "I'll draft one later. How's it going with Howard?""Fine.""Why isn't he here? I invited him to this meeting. Go grab him, will you?"Genesis went over to Howard's desk, and over his blaring music, said, "Hey, I think we have a meeting. Did you get Alexa's Slack message?""Hay is for horses," Howard said, "and I don't check slack. I'll be there in a few minutes. Alexa is always running late anyway."When the entire team was settled in, Alexa laid out the problem. "Our longest client is an author called ForeverNap. They reliably publish every Saturday, but have a whole complex pricing approach they want. It's great revenue for us, but it means that every Saturday, someone has to go and manually change their entire pricing model- and since they're one of our biggest publishers, that someone is me. Every Saturday, I get up at 6AM and manually fix it. Can we automate this at all?""I think," Genesis said, "this would be pretty easy to add a custom code path in the Django models, though long term we might need to do some serious refactoring if we wanted to scale this-""It can't be done," Howard said. "ForeverNap's pricing can't be changed through the code. If we did that, we'd slow it down for everyone else. This could lead to a bigger issue down the road, and as Genesis was hinting at, it isn't good coding standards." He turned to Genesis and added, "I have some concerns that if you find it difficult to come up with a solution that you'll be able to maintain in the future. You know I've got 19 years in this business."Genesis let Howard's statements hang in the air, and said, "Okay, I was hired because I'm a Python and Django expert, but this code is a bit rough and it's my first week. I'm pretty sure I can support this and get up to speed, but I think for now we'll defer to Howard's expertise."The rest of the week followed that pattern. Alexa would raise a concern. Genesis would offer at least a first-draft solution, Howard would explain why that couldn't be done and offer no solutions of his own. At least, that's what happened when Howard was paying attention in the meetings, which wasn't often- Alexa frequently needed to repeat her questions to him.Saturday morning, Genesis realized she'd left her headphones in the office. On her way out to enjoy the weekend, Alexa swung past the office. Walking in, she was hit by a wall of cigarette smoke. Alexa was behind Howard's desk, her laptop out, typing away. Caught misbehaving, Alexa coughed out, "What are you doing here?""I forgot my headphones," Genesis said. "What about you?""Ah, yes. Like I said in the meeting, I manually change the pricing. So I come here and enjoy a cigarette for special occasions."Genesis sighed and walked to her desk. ForeverNap released their new uploads at a 40% discount for the first week. It was trivial to add a simple conditional that automatically updated the prices for that customer only. Genesis ran some quick tests on her local build, pushed it through CI, and then released it.The load on their service was never terribly high, so the chances of hurting response times was low, but Genesis had also set up enough alerting that, if this blew up later, she could just revert the change from home. For now, though, it made sure that all of ForeverNap's uploads would come in at the new pricing."You can go home now," Genesis told Alexa. "We should probably talk more about how we want this feature to work in the long run, but you at least don't have to come here at 6AM anymore.""Oh, great," Alexa said. "No more special occasions." She looked at her cigarette wistfully. [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!
CodeSOD: Vestigial Organs
Matt inherited some C# code that reads from a JSON config file.
CodeSOD: Misunderstood the Assignment
Benjamin doesn't have a lot of complaints about the project he works on. "There is," he writes, "no tale of daily woe." But even an otherwise healthy project isn't immune to WTFs.
CodeSOD: A Reckless Driver
For a variety of reasons, Robert's company needed to ship a small linux box with a USB ethernet adapter. The driver for said adapter was giving him some issues with their setup, but fortunately the driver was open source, so Robert could at least try and diagnose the problems.In the file inst.c, he found this:
Error'd: 500 Miles
Strictly speaking, closer to 700 miles than 500, butif we really cared about precision we'd just go insaner.Peripatetic Jonathan calls out an inappropriate use of lexical sort, as he wryly suggests he'd be"Just popping over quickly to the nearby store which is 1200km away from me." But he entirely missed also calling out the odd location of the Pargo Greatlinks cafe. We've got you covered, Jonathan.
CodeSOD: No Lifeguard in this Connection Pool
Michael was debugging a system where the J2EE service would just... crash. It was running on a Windows host set to restart the service when this happened, so the outages were brief, but it was a serious problem.He eventually tracked down the problem to a class called JdbcSchema, which is about 1,100 lines of homebrew database management code. It does "fun" things, like create extra tables in the database to track "foreign key metadata".Or, for real fun, it has a getTransIsolation function, which returns the transaction isolation your query should use. If you're thinking to yourself, "doesn't the transaction isolation depend on the specific query and workload?" you'd be right- this function changes what transaction isolation all queries are supposed to use based on the time of day. Presumably, this was to support batch processing at night, but it's a bonkers way of going about it.None of that, however, is why the application crashed.
CodeSOD: Monthly Totals
Daniel spotted an array called $months in a PHP application. The data being stored in the array was some total of the sales of some commodity, for the past 5 months.That much all made sense. What didn't make sense was how the array was indexed.
CodeSOD: Secure Mentorship
Sophia entered the software development industry through an "alternative" path. In Germany, they have a tradition of Ausbildung. Instead of going to university, you focus on on-the-job training with some classes mixed in. There are still exams and all the traditional academic trappings, but with one huge bonus: you're working closely with an Ausbilder- an experienced industry veteran who can show you the ropes.Sophia's Ausbilder was named Tim, and at the company she was working at, he was widely hailed as a genius. He had designed their entire web system from the ground up in Java, which given that every other developer at the company only worked in Delphi, that made him a pretty unique talent. Everyone was pretty convinced he was brillant.Sophia, who at this point was fairly novice in the industry, was excited to work with him. That lasted about five minutes.It didn't take long to discover that the entire system was constructed around god classes that just bundled a pile of unrelated functionality into an undebuggable blob. Sophia has lots of things she wants to share, but today we want to look at one specific class, helpfully called ModuleClient:
CodeSOD: Padding the Amount
Matt's co-worker needed to handle some currency values coming in as strings. As this was in C++, we're already in a fraught territory of having to worry about whether the callers and various APIs we're using handle C-style strings or C++ std::string.Or, you can just mix-and-match in code and hope for the best, while having some interesting approaches to handling your inputs. That's what this developer did.
12345678910...