Feed the-daily-wtf The Daily WTF

Favorite IconThe Daily WTF

Link http://thedailywtf.com/
Feed http://syndication.thedailywtf.com/TheDailyWtf
Updated 2025-12-16 07:31
Error'd: It's a Kinda Magic
"One of the UK's leading motoring organizations needs a little help in wand waving on its route planning web site," Cameron wrote.
The Daily WTF: Live: Meeting Halfway
On April 10th, I hosted The Daily WTF: Live! in Pittsburgh. It was a blast. We had a great crowd, and some great performances.John Lange attended the storytelling workshop I co-taught with Kevin Allison, of The Story Studio. His story- about gaming, and friendship, and technology- really struck a chord with me, and I wanted to make sure he got a chance to share it.
CodeSOD: Reversing the String, Belaboring the Point
The position had sat open for months now; the department was straining under the load of too many projects and too few developers, but the pool of candidates was rapidly shrinking. So when Cindy found a resume that looked halfway decent, she immediately recommended tossing them a programming test and scheduling an interview. The phone screen is a bit superfluous given fifteen years experience, she thought. We'll just use a quick test and get to the good part.The test was simple enough: reverse a string, in your language of choice. They were hiring iOS developers, so the candidate was wise enough to choose Objective-C- usually a great choice to demonstrate that you won't need much training on the job.However, generally, you ought to actually be good at the language in question...
Take A Bold
“Hello!” A perky voice chirped over Evan’s shoulder. “May I come in?”It was unbearably early in the morning. Evan had yet to get into any sort of programming groove, and so swiveled away from his computer without difficulty. At the threshold of his cube waited a sunny young morning person he’d never seen before. Beside her rested a re-purposed overhead projector cart. Instead of AV equipment, it bore dozens of shiny new coffee mugs.“Hi! My name’s Kelly.” Beaming, she stepped forward and offered the mug in her hands. “A little treat from the Marketing team! We’re celebrating the creation of a new recruitment bonus program!”Bleary-eyed and far less enthusiastic, Evan took the proffered mug. Harsh florescent lighting glared off its glossy surface, which read:Take A <b/>“Cute, huh?” Kelly asked.Evan managed a limpid half-smile, and nearly dropped the mug alongside the other glorified dust-magnets in his cubicle, before something made him do a double-take. “That’s the wrong tag.”Kelly frowned in confusion. “What?”“There’s a typo,” Evan said. “You wanted ‘Take A Break,’ right? That should be B-R-slash, not B-slash.” He pointed to the mug for emphasis. “Right now, it says ‘Take A Bold.’”“Are you serious?” The smile vanished from Kelly’s face. Her eyes went wide.“Yeah,” Evan said.“Really?”“Serious.”“Really?” Kelly bit her lip, but her eyes betrayed her mirth. “Oh my goodness. You have no idea how many meetings we had. This slogan got batted around everywhere, up down and sideways, and no one ever said anything about that!”How many developers were at those meetings?” Evan asked. The company offered hundreds to choose from.“None. This was all within Marketing.” Kelly giggled freely. “This is everywhere! We’ve got posters, t-shirts, pens…!”Evan joined in her laughter. “Of course. Printing promotional materials is our core business!”“Don’t tell anyone else about this, OK? I’m kinda curious to see how long it goes before someone else brings it up.” Kelly returned to her cart and pushed it away, still red-faced and giggling. “Have a good one!”Heh, typical. How often did Marketing ever vet anything with IT, or even think to? Evan couldn’t even think of any marketers or computer folk who had regular social contact with one another.Well, maybe that’s about to change, he thought with another smirking look at his new mug. The two teams could bond over some nice coffee bolds.[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!
CodeSOD: A Winning Strategy
“Hey,” Roberto said while pairing with an offshore programmer, “this problem would be easier to solve with the Factory pattern.”“What’s that?”Roberto explained both the Factory pattern and the idea of design patterns, and congratulated himself on helping a fellow developer improve their skills. Little did he know, he had created a monster.Things started cropping up in his code base. For example, Roberto found this block:
Error'd: Tell QA They Missed One
"You know, I've always wanted some sideways text that says 'not for sale'," writes Julie, "Too bad I'll never know."
CodeSOD: Sea of SQL
Andy writes: “Operations reported that a query was taking a long time. Even the 'developers' of this query didn't know why it was taking a long time.”I tell ya, folks… some submissions, you just set down and back away slowly… then hunt up a magnifying glass and a bottle of aspirin.
Like a Well-Oiled Machine
It was Housekeeping Sunday in Dirk’s small IT shop, which usually meant taking their diminutive lot of servers down for routine maintenance. Dirk thought he’d change it up this week and add some actual cleaning to their housekeeping tasks. He knew just the man for the job too - Andrew, the Big Boss’s nephew.
CodeSOD: Recruiting Desperation
When hiring programmers, recruiters will often try to be “clever”. Sometimes, this results in a memorable trick, like EA Canada’s job posting billboard.Other times, these stunts don’t go nearly as well. Andrea recently got this job posting from a recruiter. Note, they’re hiring for a PHP job.
Pizza Hacker
...and at 10PM, see if the investigators can track a killer who hacks an online game and tricks children into delivering illegal weapons on the next episode of...It was a quiet, lazy evening. Alan C. was in bed with his wife, getting his well deserved rest after a hectic week at work. Just as he picked up the remote to raise the volume, he was startled by a long, low growl."Hungry?" his wife muttered without opening her eyes."Guess so.""No way I'm cooking anything today. Let's grab a pizza."Alan sighed and picked up his laptop, looking for a pizza place nearby.Mario's Pizza - the best pizza in town! the first Google result screamed at him. Order by phone or online!Not wanting to disturb his half-asleep wife, he entered the website and clicked the big "ORDER ONLINE" button. After a few minutes of picking ingredients, sides, drinks, and sauces, he was ready to place his $50 order of "true Italian goodness". He scrolled down to the end of the form to submit it.Then he scrolled up. Then he scrolled left, right, and sideways, but no matter where he looked, he couldn't proceed with his order. The submit button simply wasn't there.But Alan wasn't a developer for nothing. A simple UI glitch wouldn't stand between him and his thin-crust treat. He fired up the console, opened the site's source, and typed:
Error'd: BSOD Could Go All the Way This Year
"Yes! I'm a huge fan of BSOD. I'm glad to see SportsCenter giving some well deserved recognition!," Mike writes.
CodeSOD: Happy Little (Read-Only) Trees
"Joey," asked Ross of the new contractor, in a slow, careful voice, as though trying to calm a large predator. "Explain to me why the data tree has this read-only flag?""It's more secure that way. Obviously, if it's read-only, arbitrary people can't write to it."Deep inside our Jar? Are we afraid of our own code? Ross wondered, but he dismissed his doubts. Sure, let him have that one. "Okay, but why is there a flag at every single node of the tree?""Well, obviously, if only the root's protected, people can still edit the leaves and branches. We want to protect the whole tree.""Okay, but that means to edit the setting you have to visit every single node, which is O(n) at best.""Price of security, man.""Okay, but even so, why do you flip the flag before every insert, only to set it again after? Doesn't that make building the tree painful?""You can never be too careful." "Okay, even if I buy all that, and even assuming that this is the best possible way to solve this problem- which it's not- Why do you visit every node twice?"
The Daily WTF: Live: Fired Up
On April 10th, I hosted The Daily WTF: Live! in Pittsburgh. It was a blast. We had a great crowd, and some great performances.You know him as the master of the Errords, the king of the CodeSODs, the Dev-Master of the Dev-Disaster, Mark Bowytz. Once upon a time, though, he was just another lowly office drone like yourself. This is his origin story: the WTF that launched a thousand head-desks.
The Bureaucracy is Expanding…
Government Department prided itself on the precision of its process and procedures. Every function in the organization had its functionary, at least in theory. Joe had only been on the job a month when he discovered that figuring out which functionary would actually function wasn’t as easy as it looked. The Department used a database known as CAS to track all its financial data, including wages and work orders. Since Joe intended to earn wages in return for coordinating those work orders, he was going to need access to CAS. His first inkling that there might be a problem with the pervasive process was that, despite all employees needing at least basic CAS access for the payroll system, it wasn’t until his fourth week with the department that Terry, his team lead, gave him the good news.“You’ve been cleared for a CAS userid,” Terry said. “Go ahead and call up the CAS service desk to request it.”“So they haven’t created my ID yet, just cleared me to have one?” Joe asked.“That’s right. The CAS desk’s extension is 8888.”Joe dialed the extension. At the other end was the cheerful recorded voice of one of those programs that asks you to say what you want instead of pressing buttons. Joe just blurted, “CAS.”“For new or returning Government Department employees,” the voice said, “contact the security unit at 8889, or speak to the CAS role 132 user from your local IT unit. Goodbye!”Joe muttered to himself and dialed the next extension. This time, the voice was neither recorded nor cheerful.“Security. What seems to be the problem?”“Well, I need a CAS account-”“You need to contact the CAS service desk.” And Joe was hung-up on for the second time in five minutes.The process having officially sent Joe in a circle, he tried the cheerful recording’s alternative. He found his way to the local IT office and asked the team lead there about CAS. The response was cheerful, not recorded… but not helpful, either.“CAS? Oh, we can’t give you that. The service desk’s extension is-”“I already called them. They told me to talk to you… something about the CAS role 132 user?”The IT Team Leader chewed on that for a while, then turned and picked up his phone. While he dialed, he looked over his shoulder at Joe.“You know, it’s funny! I just finished getting CAS accounts for some new team members- took three days in the end!”Joe grimaced. The IT TL spent some time saying “uh-huh” into his phone, then hung up. He asked for Joe’s TL’s number, and promised to walk Terry through the necessary process. Joe returned to his desk and waited. That afternoon, Terry popped in to give him the good news.“I sent an email to that address IT told me about, it bounced back saying we need to contact the local CAS coordinator. I just emailed her, so we should be good to go any time now!”Terry left, and Joe returned to his job of waiting to be allowed to coordinate work orders. Fortunately, it didn’t take long to get a reply from the CAS coordinator. Joe was CCed:
CodeSOD: And I Try, and I Try
“If you want to put everything under test, you have to write code like this.”At least, that’s what Alex’s co-worker said to him, when Alex demanded an explanation for this block of code.
Error'd: You're Welcome...?
"I clicked 'Yes' when asked if I wanted to send a report of VLC's crash, but apparently my attempted cooperation wasn't really appreciated," David K. writes.
Announcements: Help Us Back Programming Languages ABC++
TLDR; I have another Kickstarter Project, this time it's a kids book about programming!##Last year, I put a project up on Kickstarter that was inspired by things I personally love: games and software. Release! was supposed to be a one-off, quick card game project, but thanks to all of your help, it got pretty popular, pretty fast. We're halfway through selling our second print run of the game, and while it'll never do well enough to pay the rent... it may just do sell enough to get us a nice bottle of scotch, which we sorely need.I had such a great time with the whole venture that I wanted to put out another project. Which leads me to: Programming Languages ABC++. Here is the idea, it's an alphabet book which has a different code language for each letter: A is for Ada, B is for Basic, etc. Each page has a "Hello World" program in that letter's language, along with some facts about the language, and a colorful illustration of our mascot, the Computer Bug.Before you say it, I do realize that a toddler won't understand the code. It's not about teaching a baby to make a program, it's about creating a way for us parents, uncles, aunts, etc. to connect with the kids in our life. You know, share a little about what we do, in a context that the kids will actually enjoy.The whole thing started with my friends Michael and Martine Dowden, a pair of developers who had an idea to make an alphabet book that was all about programing. Within seconds of them explaining the idea to me I knew this would be the next fun project.Anyway, the project is live, and you can score a book for just $15, or a number of other fun rewards. Even if you don't have any kids in your life, and you've mastered your ABCs, backing at a $1 is still a great way to show your appreciation -- which, of course would be much appreciated![Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!
CodeSOD: The Forest of Trees
Sally’s co-worker wanted to turn some data into HTML. It would flow from his application into client-side JavaScript which would build the DOM. He decided that it made sense to use a tree to represent the data as it’s translated.The C# declaration of his tree looked something like this:Dictionary<int, Dictionary<CatalogLoader_Helper.CatalogNode, List<CatalogLoader_Helper.CatalogNode>>> treeOBJMODEL;Isn’t it fantastic how Generics can make your code more readable and type-safe? I mean, that’s not what’s happening in this example, but…To traverse the tree, he used a terse, readable block like this:
The Daily WTF: Live: The Life and Death of Steel City Ruby Con
On April 10th, I hosted The Daily WTF: Live! in Pittsburgh. It was a blast. We had a great crowd, and some great performances.Today's installment investigates exactly how a conference comes into being, told from the inside of Steel City Ruby Con.
CodeSOD: Version Logging
When a system evolves and grows, it's usually necessary to identify various versions of software living in the wild. There are many ways to do that: some hide their version numbers in code, some keep them in configuration and metadata files, and others store them in the application's database.No matter the scheme, accessing and modifying the current version number should be easy and painless- that is, unless you're working with Stan K.'s codebase. In a truly brillant case of reusing existing system facilities, the developers resorted to a much less common method of determining which patches and upgrades have been applied:
More is Better, They Said
Error'd: Used Shellfish
"According to channel 7 in Australia these guys are right into trawling for content," Martin.
Source History Information Tool
In technology as in life, some folks get it, and some don’t. Trying to make the ones who don’t get it get it can sometimes challenge even the hardiest of tech-souls. Michelle made a valiant effort to enlighten one such individual, and failed. This is her story.Michelle’s predecessor had migrated their code-base from VSS to SVN, before fleeing for the hills. Michelle was “the replacement.” Before she finished finding her cube, she was cornered by her manager and peers with some concerns. “About this new-fangled SVN source control system,” they began, and then they tried to pin her down as to how she could address their “issues”…Specifically, Bob, the manager asked: “Is it true that in SVN, anyone can check-out the code?”“Of course”, Michelle replied. She explained that anyone with an account can check out the source code at any time. This started an avalanche of stupidity that, not unlike one of snow, only gained mass and momentum with time.Jim, the lead developer, said that this was a problem. “If I checked out a file, I would have no idea if someone else was working on that file as well.” When Michelle just looked at him, blankly, he continued: “VSS was much better in that respect.”Michelle explained that this was the whole point, and in fact, one of the main benefits of SVN. Unlike VSS, SVN supports concurrent development, and it’s smart enough to automatically keep track of who’s changing what for you.Jim was worried that if he was working in an area of code, he needed to know that nobody else was working on it, so his change(s) wouldn’t get overwritten by the other developer.Michelle went on to console him by explaining the concept of merges and how merge collisions would be handled.“Yeah, but we’re working on a major bug and need to know that no-one else is working on those files!”Michelle then explained the concept of branches. She further explained that the file history was available for examination, and in an extreme case, an automatic email notification could be sent where anyone on the mailing list would receive notification every time someone committed code.Bob and Jim would have none of that. Bob complained, “No that’s not good enough. We can’t risk developers clobbering each other’s code. You need to change this. When I go to the bathroom, I have exclusive use of the stall. Others can only use it before me or after me, but not at the same time as me. We need this same level of isolation in handling our source code.”Try as she might, there was no explaining that this was really not necessary, as going to the bathroom and editing source code were, in fact, two very different things, and that it defeated the point of a multi-versioned, concurrent development environment…Bob insisted, in absolute finality: “No it’s too dangerous. Please change SVN to make to make it single check-out only; now! Before something terrible happens!”In reality, something terrible already had. Michelle resigned herself to the stupidity of running source control in the same way as accessing a toilet, she wrote a trigger script hack to disable parallel check outs. But at the end of the day, she couldn’t bring herself to activate crap mode.[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
CodeSOD: One In a Million
Marcus inherited a big-ol-ball-of-mud PHP application. The entire thing is one difficult to summarize pile of WTF, but he searched long and hard to find one snippet that actually summarizes how awful the code is.That snippet is this:
The Daily WTF: Live: Killing the Virus
On April 10th, I hosted The Daily WTF: Live! in Pittsburgh. It was a blast. We had a great crowd, and some great performances.Our first story is one of my own- a tale about how one computer virus finds its violent end.
CodeSOD: Universal Printout
It had been a long meeting, and Bert was exhausted. Now, normally when a story on TDWTF starts that way, we go on to tell you about a hapless developer trapped in management hell, but this time, we're flipping the script on you: Bert was the Business Analyst on a project to enhance some self-check software for a number of supermarket chains. Ernie, the Software Engineer, was one of those braindead devs who needs everything spelled out before he'll write so much as a line of code, and Bert was much more comfortable with the looser specs in Agile projects.Since the fourth Requirements Clarification Meeting was dragging on into hour two, Bert was getting a little snippy. So when Ernie asked for clarification on exactly how long a given printout might be, in millimetres, Bert couldn't help himself: he cracked. "Well, potentially infinite, I guess!"The code Ernie delivered:
Error'd: The Answer to this Question is WTF?!
"For a site that is used to view pay stubs, you'd think that they'd come up with better security questions," Carter K. wrote.
CodeSOD: Open And Shut
Our anonymous friend writes: I was tasked with figuring out why invalid XML was being output by a homegrown XML parser. As I looked into the code, I found the way this code handles writing out XML files…Yes, it really does open and close the file handle for every xwrite call. This means that it opens and closes it 3 times PER TAG when writing out the XML.
The Industry Vet
Like most schools, Andy’s requried a “capstone” project for their software engineering track. It was a group project, which meant the project’s success was largely dependent on the luck of the draw. For his partners, Andy drew Mindy and Al. Mindy, he knew from other classes and had worked with before.Al was a stranger, but Al had made his presence known from the very first day of class. You see, Al had industry experience. Al had been working with a global manufacturing company for a few years, and didn’t really need this class. He lived this stuff. He knew more than the professor, so Al spent most of his time trying to help the other students, even going so far as to hold is own informal “office hours” in one of the computer labs. At their first team meeting in one of the conference rooms in the library, Al explained, “This project here looks pretty close to some of the work I’ve been doing.”“You’ve implemented a database for a library to track users and assets?”“Not exactly,” Al said, “but it’s a basic data-driven application. I’ve written thousands of these.”“That’s really great to hear,” Andy said, “because Mindy and I haven’t actually taken the databases class yet- we don’t really know SQL.”“Great!” Al said. “I can work on the data-layer.”As an experienced enterprise developer, Al took the weekend to write up a specification for the database layer, which he gave to Andy and Mindy. They could use a stubbed version of the database layer, while Al did all the work on that side.“Now,” Al warned as they reviewed the latest ER diagrams in a quiet corner of the campus coffee shop, “I’ve worked on a lot of projects like this, so let me warn you- we’ll probably need to spend some time doing some serious integration testing to link all of these modules together.”“Oh, I’d expect as much,” Andy said. “If you can finish your work within the next week, we’ll have two weeks left to do our testing.”“Will do,” Al said.Al didn’t do. He didn’t get his database layer committed until one week before the due date. He skipped the next team meeting and sent an email, “Project crunch at work, not available. Will send updates.”Andy and Mindy fired the application up with a pile of instructor-provided test data. It took nearly 100 seconds to filter through the 1000 test users and find a single user’s account. Performance got worse with larger data-sets, like the list of books in their “library”.If it were just poor performance, Andy would have thrown indexes at the problem and hoped that cleared things up. There were worse problems, though. For example, according to the database, today’s date was “Martha Sawyer”. User “Jim Mahony” had $–155132 in late fees, there were 15,005.542 books in the database, and 16,000 of them were available to be checked out to users.Andy decided to take a look and see if he could address those bugs. He immediately regretted the decision, because one look at the code told him that he had just given up on getting any sleep for the next week. Al did okay at managing database connections, but his “vast” industry experience apparently didn’t include the use of the “where” clause. Every single query he wrote followed the pattern:
CodeSOD: Once You Eliminate the Impossible…
…Whatever remains, no matter how improbable, must be XML.Developers have many weaknesses, among them this: they don’t like to say that something can’t be done. That’s why when Glenn M’s client, TelCo, asked if their request was really impossible, instead of apologizing and vigorously nodding his head, Glenn said, “Well, technically…”And that’s how he ended up writing this.
The Third (Party) Circle of Hell
While Ian was working at Initech, one of the major projects he undertook was an integration with a third-party vendor. They had recently gotten set up with this product that became known internally as the Third Circle of Hell (3CoH), and wanted to export some data from it over to the vendor's website. Sales agents needed some information during cold calls, and 3CoH promised to provide the data interactively, so that they could continue their call somewhat intelligently.Getting in to the 3CoH might be easy, but getting out is another matter.The existing system was manual and thus slow and rife with error. Sales agents would have to copy all of a customer's information, by hand, from 3CoH into a web form, which boiled down to a lot of copying and pasting. But since the vendor provided a SOAP API and 3CoH had its touted scripting language (essentially Java with some syntactic sugar for querying the 3CoH database), there was probably a way to automate the process. The task of doing that was assigned to Ian.Of course, going directly from 3CoH to the vendor was out of the question, as it would involve hand-crafting a SOAP request and filling in fields by just concatenating together a giant string of XML with some variables. Some of his predecessor PHP developers at the company had thought that was a perfectly fine thing to do, and had created some scripts to employ that anti-pattern.Ian had a less fragile idea in mind. With the aid of a Java library that generated Java classes from a WSDL, he set up a bridge server to stand between 3CoH and the vendor. 3CoH would package up all the needed information into JSON and send it to the bridge server. The bridge server would shuffle the data from the incoming JSON into the objects representing the SOAP request, generate the SOAP request, and send it off. When the reply came back, the process would go in reverse; the bridge server would pull out the URL returned by the vendor, and send it back to 3CoH as a regular HTTP response.After a few development iterations, it worked, albeit slowly. That is, it would take about 30 seconds for the whole process, which is a long time when you're on a cold-call with a customer. Even worse, it would make Chrome assume the page had frozen and pop up a scary-looking dialog box to that effect. Ian was testing by pointing to the vendor's QA website and not the real one, so he naturally assumed this was the cause of the slowdown.He was wrong.Once they went live, he found that it was still just as slow, and the sales agents and managers were not happy, summarily resulting in various high-level managers alternately panicking about a failed project and spewing brimstone and fire down his neck about getting it fixed.But the surprise came when Ian timed each segment:
Error'd: Nothing Refreshes like Lorem Ipsum
"How new is this beer? They didn't even finish the packaging!" wrote Jérôme.
Failure is OK
Roland was working on code that implemented HTTP service methods. The 'status' variable held one of those pass-it-everywhere objects that were sometimes called 'RunData'. It contained the request, response, security context, and other needed information. When JavaScript sent an asynchronous HTTP request, one of the service methods performed some backend magic and returned a JSON object with the appropriate data.That was the good case. In the bad case, the service method called status.fail, added one or more user messages, and returned without sending a reply. The error handling in the base class detected that the call failed, and sent an error response containing the user messages.Roland had just introduced that pattern, which was meant to put an end to the convoluted error handling in older parts of the codebase. It seemed to work well. Then one day, he encountered a different use case: a service method that didn’t return any data in the good case. For the sake of symmetry, he decided it would return an empty JSON object, and got to work implementing that.You're doing something wrong, his inner voice cautioned.Roland had just copied some code from the good case of another service method: setting the MIME type and charset of the response, getting the OutputWriter, writing the data, closing the stream. Five lines total.Still, he supposed his inner voice was right. Five lines of code for an empty reply was a bit excessive, but that was how he’d implemented the good case elsewhere.Yes it is, the voice said. But for this? There's got to be a better way.Roland reviewed the base class, checking whether there was any code he could reuse. Unfortunately not. The five lines were built into the error handling logic, and could not be invoked directly.Time for some refactoring, the voice said.Roland cringed hard at the thought. He’d spent so much time in the base class already. He was thoroughly fed up with refactoring.You've got all the access you need, and you've got the source code in the editor already! Go on now...Just as he was about to give in, Roland noticed something interesting: when he triggered the error handling without adding user messages, it sent an empty JSON object.What the hell?And he could specify the HTTP status code! Roland set it to 200.
CodeSOD: Tri-State Boolean
"Lindsay."Lindsay did her best to ignore her co-worker, Asher. Ever since management had removed cubicle walls (to "facilitate communication"), it had been a never-ending trial focusing on fixing bugs with the world's most annoying webdev prodding her every few minutes to talk about some inane television reference or sports event."Lindsay."Lindsay closed her eyes, picturing the Maui beaches where she hoped to be reclining in two days time. Surely she could hold out that long, right?"Lindsay!""What?!" She snapped, ripping off her headphones to look at his screen."Did you see that P1?"Stunned that Asher was actually bothering her about, wonder of all wonders, work, Lindsay closed her travel agent's website and pulled up the bug tracker.Sure enough, she'd been assigned a P1 defect. In the self-service component of the Procurement website, all users were able to download a spreadsheet containing the price lists for...Lindsay gave a low whistle. "Is that every client's price sheet?"Asher nodded, face grim. Pricing was a strictly held secret in the business-to-business world; if one client found out another was getting a deal they didn't qualify for, there'd be hell to pay. Only admins should've had download privileges, but somehow, that download button was enabled for every user of the site.Priority one was usually reserved for "the entire site is down." A price sheet leak was pretty much the one exception.It was easy enough for Lindsay to pull up and duplicate. She wondered how long the button had been incorrectly enabled. There was no indication in the ticket. Lindsay called the user, who explained they'd just noticed the problem. "But who knows how long it's been that way?"Crap. It wasn't just a simple matter of reviewing what had changed since the last build. Lindsay pulled her headphones back on, switching from relaxing white-noise to something more upbeat while she brought up the debugger. Three grueling hours later, she found the reason why any and every user was able to download the price sheet:
Seven Minutes in Heaven
Steven quietly bowed his head as the planning meeting began. Their leader, messiah, and prophet was Jack, and today’s sermon was was the promise of Heaven- Heaven being the codename of their ground-up rewrite of their e-commerce solution.
CodeSOD: Descriptive Overload
Unquestionably, a good method name should be descriptive. With today's code completion and code analysis features, almost all developers expect the names to give them at least an idea of what a method should do. When you write a library, or work on a shared codebase, it's a must- and even if one doesn't expect anybody else to use their code, it's still good not to have to remember what stuff doStuff() does.Some people, however, take it a bit too far. Today's example of abusing good practices was provided by David, who sent the following code with a comment: "This code takes $10 million USD in transactions a month". After reading it, it's fairly obvious the developers shouldn't be trusted with the loose change in their pockets:
Error'd: Laser Targeted Advertising
"I know that whenever I sit down to watch the adventures of brutal 14th century Mongolian warlords and Italian explorers, I want to dress the finest from my Ralph Lauren collection. And you should too!" writes Mike S.
The Big Box Hot Box
The average big-box hardware store is like a small city. They have every piece of hardware or tool imaginable (except, of course, the one you’re looking for). You’ll find no less that 15 aisles of power tools stocked with everything from battery operated screwdrivers to arc welders. To store all these tools, you can purchase the 6-foot-tall rolling toolbox, with a 20-watt stereo, built-in beer chiller, wi-fi connectivity, and a Twitter or Facebook app. One aisle over, there’s row after row of pristine white toilets, occupied by a small army of playing children. Near the back of the store, nestled between endless rows of storm doors and windows is a quaint “grocery” section, as if someone uprooted and transplanted a gas station convenience store, and trimmed away all of the bits that weren’t junk food. Finally, outside the building, is the drive-thru lumber yard, where you drive to the end to purchase your 20 cubic feet of mulch and invariably get stuck behind an idling vehicle abandoned by a socially-clueless DIY-er who either disappeared on an epic quest to find help loading 200 short tons of bagged white river rock into his 1993 Ford Ranger, or more likely, thought it was a convenient parking spot while he left for an 8-week sabbatical on a mountain in Tibet.Scott loved working in such a store while going to college for an IT degree. He didn’t work on the floor, where the poor retail staff dealt with angry customers trying to negotiate down the price of a few 2x4’s, or trying to return 1000 pounds of tile (which was clearly defective because it shattered when they dropped it on concrete). Scott was the store’s IT tech, doing all the tasks that Bob, the store’s “IT Associate” and self-proclaimed “computer expert”, should know how to do but didn’t.Scott got an after-hours call that the computer system was entirely down, and Bob couldn’t figure out the problem. This was strange, since Bob was the “expert”. The small server closet, designed and installed by Bob, was supposed to be entirely redundant. The server had a hot spare and both systems had redundant power supplies.“Scott, glad you’re here!” a panicked cashier greeted him as he ran into the store. “We can’t run any transactions and the customers are getting furious!”Scott quickly made his way to the small closet in the back of the office area. Both servers were off, with no power at all. Pushing the power buttons did nothing. Meanwhile, he could hear irate customers with access to power tools and sledgehammers berating the helpless cashiers whose registers were offline.He traced the power cables from the server and facepalmed when he discovered the problem. Each server had two power supplies. The first power supplies were plugged into a nice, long-corded surge protector, which connected to the wall outlet. The backup power supplies were plugged into a $3.50 power strip somebody had pulled from the store’s shelves. Those cords weren’t long enough to reach a separate outlet, thus it was plugged into… the first surge protector!The room was fairly warm, and with the full load of two “redundant” circuits, the surge protector had overheated and tripped its breaker. Scott rewired the power supplies into an actual redundant fashion, reset the surge protector, and had the registers back up and running within half an hour. He called it a day and went back home.Until an hour later, when the cashiers called him back in: everything was down again. Now that the servers didn’t die when it got mildly warm in the room, it had turned into a furnace. Bob, the “expert”, was busy trying to fan the heat out with a towel when Scott arrived. Scott set up one of the industrial fans in the store to ventilate the room and called maintenance to get someone to look at the HVAC system.The fan got the servers cool enough to keep running, but Scott and Bob waited around to see what maintenance found. One of the technicians grabbed them. “Did you know the thermostat was set to 45ºF?”“What?” Scott blurted.“Of course,” Bob said. “Computers should be as cold as possible. They run better.”“Not that cold!” Scott said.“Well, you can’t keep them that cold,” the tech said. “The AC unit just runs continuously, and the coils get so cold that they start to freeze. Literally- your AC unit is a block of ice right now. Leave it off for a few hours, and then turn it back on at a reasonable temperature.”That day, Bob and Scott followed their instructions, but Bob remained unconvinced about these warnings. As the seasons transitioned into summer, he cranked the thermostat lower and lower. Through the hottest months of the year, Bob caused six more heat-related outages as he did his best to destroy the AC unit. Fortunately, they worked in a hardware store. Scott installed a lock-box over the thermostat and told Bob that maintenance had done it.[Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!
CodeSOD: Delete if Not Exists
Early in life, we learn to grab the food and then put in in our mouths. Later, it's grab the ball and then roll it. In general, you must have something before you can attempt to do something with it....Or so you'd think.While trudging through the migration of their code from one SharePoint solution to another, S. T. encountered this soul-sucking comment about the code that follows:
The Monolith
“It’ll be a cold day in Hell,” Roger said, “when this system goes down.”
Announcements: The Daily WTF: LIVE! - This Friday
This is your reminder: TDWTF's live show is happening this Friday, from 8–10PM at the Maker Theater in Pittsburgh. Tickets are available now.We still have room for a few more storytellers, so if you're in the Pittsburgh area, pitch us your "real life" IT story. It need not be a WTF, just a story. Send a brief (1–2 paragraph) pitch for your story to storytelling@jetpackshark.com, and Remy will be in touch to discuss. We'll work with you to build up a great 8-10 minute piece you can perform.This event is brought to you by our awesome and proud sponsor, Puppet Labs*. As we mentioned in their sponsorship announcement article, thanks to their support, we’ll be able to create some exciting new content, do more meet-ups, and have a lot more fun all-around. This is an example of that and we are still very excited to be working with them! Check out their intro video, it gives a pretty good overview of how they help their customers get things done.We’d also like to thank Code & Supply for helping us network with the Pittsburgh IT community. Code & Supply is the largest IT community group in Pittsburgh, with frequent meetups and a variety of activities. They’ve helped connect us with performers and are helping promote the show with their community. They even let this guy give a talk on using storytelling to communicate technical details.[Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!
Classic WTF: The .NET Bridge to Nowhere
Error'd: Phenomenesia
"We don't know what it is, but it must be bad, so we'll wake you up in the middle of the night to let you know about it!," writes David L.
CodeSOD: Scheduling Buttumptions
Steph had been at this job long enough to be fairly good at it, but not quite long enough to have peeked in all the dark corners yet. As such, when she heard that there was an issue with scheduled jobs, her first thought was to poke through cron to see if she could pick out what schedule was misbehaving. Apparently, all of them- cron was empty.Confused, she went to her team lead Greg, asking about where she might find the scheduling setup. And that was when she heard about Travie the Whiz Kid. A junior developer with no degree, he'd been hired solely based on his ability to talk a big game about how he single-handedly saved several companies by providing them with innovative websites during the dot-com bubble... when he was twelve. The Whiz Kid was a Special Snowflake; he preferred to reinvent the wheel rather than implement stable but "boring" code. Upper management was convinced he was an unparalleled genius, and had exempted him from the usual QA standards. Unfortunately, he'd grown utterly bored with Business Intelligence and transferred to the Web team, leaving his inventions behind for Steph to maintain.Travie had been tasked with writing a helper application in Java to interact with and process data from a third-party web service. The third party processed their data on certain days at certain, known times, and their app needed to wait and pull down the data after it was guaranteed to be there. The ticket involved the wrong data being collected: at 5:15AM on the second of the month, the script was pulling in the previous month's data to process, rather than the current. Was it running early?Steph found the repo with the Java code The Whiz Kid had written and checked it out, skimming over the list of files as she finished her morning latte. She opened the Schedule class, winced, and closed it again. "Definitely need more coffee."
Radio WTF Presents: Quantity of Service
Radio WTF Presents!Jump to transcriptToday's episode: "Quantity of Service", adapted for radio by Lorne Kates, from a submission by LyfeLinks To Downloads
The Upgrade
James stood on the precipice of a significant upgrade to his company’s reporting capabilities. Purchasing had cut a deal with the vendor ÜberWarehouse to upgrade their warehouse inventory tracking system from a basic .NET application with limited functionality to a full-blown data warehousing system. He jokingly called it the “Warehousing the Warehouse Project”. He was the only one who found it funny.
Announcements: Another Tokyo Meet-up: Sakura Edition
I'll be in Japan once again, and figured it'd be the perfect opportunity to celebrate Hanami with Tokyo-area TDWTF readers:Hanami (花見) roughly translates to, hangout with a group of friends and colleagues under a cherry blossom tree while drinking beer, sake, and possibly whisky, along with enjoying various snack foods. As the above picture above (courtesy of Ari Helminen on Flickr) depicts, it's pretty much the thing to do in Japan this time of year.So, if you're up for getting together this Friday (possibly Saturday?) for Hanami, and likely an izikaya afterwards... please drop me a note via the contact form or direct, apapadimoulis/inedo.com.[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!
Announcements: Would You Like to Take a Survey?
Our sponsor, Puppet Labs, wants to know what your DevOps needs look like. Take their survey, and be entered to win some valuable prizes.[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
CodeSOD: Rube Goldberg's Password Generator
One of the well-known rules of life is that the most straightforward solution is usually the best solution. Obviously it's not always possible to "keep it simple, stupid," but one should aim to make their creations as self-explanatory and to-the-point as possible- otherwise it's easy to end up with a nightmare in terms of both maintainability and performance.Some people, however, have chosen to defy that rule. One of them was Rube Goldberg. This engineer turned cartoonist became famous for inventing ridiculously complex contraptions to achieve the simplest tasks. And while Mr. Goldberg passed away in 1970, the concept of a "Rube Goldberg machine" outlived him, showing up in hundreds of cartoons, events, and comedy movies.And, as Matt R. learned, it also made its way into his codebase. While refactoring and rewriting a 32,000-line long file, he came across this incredible machine:
Error'd: We'll Take All the Help We Can Get
"I was casually browsing Bingo games and this one asked me to finish developing their site for them," writes Steven W.
...535455565758