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
CodeSOD: Save Yourselves!
Scott K was cleaning up a configuration utility used by his team when he dredged up this sanity-threatening artifact:
Error'd: No Color? No Problem!
"Samsung's printer technology must really be something," writes Tim, "A black and white printer able to output a full color photo?! Who knew!"
Coded Smorgasbord: If You Want To
We pick on date handling code a lot here, simply because there are so many ways to mess up date related code (because dates are hard). In a way, it’s almost like we’re cheating. Even smart programmers could mess that up. What about basic conditional logic? How hard could that be to mess up?Well Jan L. came across this solution to a simple boundary check- if telegramType is between 100 and 199, it is a payment type telegram.
What's The Password?
"So, first day, huh?""Yeah." Jake loosened his tie nervously and straightened his suit. Standing in a room full of geeky-looking guys in T-shirts and hoodies, he felt like a time traveller from centuries past."Don't worry, a few days and you'll get a grip of how we do things around here." Steve, Jake's superior and tour guide, couldn't suppress a sly smile at the expense of the new guy. "Anyway, that's our office, here's your desk." He pointed to one of the open plan seats, quickly swiping an empty Coke can off of it. "And remind me, you're the back-end guy, aren't you?""Well, my strong suit is database work, but I know Ruby and PHP too," Jake said. "Also some basic HTML and CSS, if there's a need.""Nah, don't worry, we have lots of people doing this. Speaking of people, let's go around and say hi to everybody, then we can grab a coffee and breakfast — there's a nice vegan cafeteria downstairs — and by 11:00 all your accounts should be set up and we can get you some real work to do.""Sounds good to me," Jake replied as they walked toward the other end of the office. "So, can you tell me what you guys are doing here?"Two hours later, after making all his acquaintances, discussing the upcoming project, and eating what appeared to be a piece of cardboard coated in sea salt, Jake finally ended up in front of his shiny, triple-monitor workstation."Okay, our SVN is at https://svn.initrode.com." Steve took a free seat nearby. "The account should be there already. You know how to connect to it, right?""Sure, but I'll need my credentials, right?" Jake asked."Oh, that's simple," Steve replied. "See, since we were tired of people going around asking for passwords, we developed this little tool called PassMan. It's sort of a keyring, keeps all your passwords together. Just open the command prompt and type 'passman'."Hearing that, something in Jake's brain instantly threw a red flag, but he kept his mouth shut. After all, the first day at a new job was not the best time to question the company's processes. For now, he decided to oblige.
CodeSOD: You've Got My Number
Today's snippet needs very little introduction. In the words of the submitter:
We're All Admins Here
Will, his boss Rita, and Nick from HR huddled around a conference room speakerphone, listening to their new marching orders from the giant company that’d just bought out their small 100-person shop. Big changes would be avalanching down from Corporate over the next several months. For the moment, they were going over the modifications required to be compliant with their new overlords’ IT policies.Twenty minutes into the call, nothing major had come up. Will dashed down notes, thinking this wouldn’t be so bad after all…Then the voice on the other side intoned, “Local admin rights for all users.”Will and Rita glanced up from their laptops with a start, sharing the same wide-eyed look of alarm.Nick glanced between them, picking up on their consternation, but unsure what it meant. “Uh, guys? Is that doable?” he prompted.“Hang on a sec.” Will reached out to swat the Mute button on the speakerphone. Then, he couldn’t help himself. His glimmer of amusement turned into a snort, then a giggle, then full-on loud laughter—laughter that Rita joined him in.“What is it?” Nick asked, more confused than ever.“Local…? Sorry. Local admin rights for everyone?” Will sat back in his chair, pressing his palms against his eyes as he recovered his breath.“It basically means we’d be giving everyone here carte blanche to install and run and change whatever they want, whenever they want, on their computers,” Rita explained. “That doesn’t sound so bad, but in reality, it makes us vulnerable to malware, viruses, security attacks, you name it.”“Some people do need admin rights to perform their jobs, but not everyone,” Will chimed back in. “It’s gonna open up huge cans of worms.”“Well, shoot,” Nick said, concerned. “I don’t know if we have much wiggle room. Let’s see what we can do.” His finger hovered over the Mute button. “You’re willing to explain to them why it’s a bad idea?”“In depth!” Will said.“OK.” Nick un-muted the speakerphone. “We’re back now, thanks. Um, so, about the local admin thing—”“We know you have objections,” one of the disembodied overlords replied casually.Will, Rita, and Nick traded surprised looks.“Most of you small fries do when you come aboard,” the voice continued. “Sorry, but that’s our policy. Non-negotiable.”This marked the first time Will had a pronounced sinking feeling about their acquisition. It wouldn’t be the last.“I really don’t want to do this,” he told Rita a few days later, poised to make the ordered changes.Rita gave an apologetic shake of her head. “I appealed it as high as I could, kid. We don’t have a choice. Do me a favor: keep track of the extra tickets and problems we get as a result of this, OK? Maybe then I’ll have the metrics I need to get someone to listen.”“It’s the metrics that matter.” With a distasteful shake of his head, Will got to work. “Can’t wait to see what comes in first.”To their surprise, a full week of peace and quiet ensued, but this was merely the calm before the excrement-storm. Early on a Monday, emails flooded the support box.Oh no where are my database icons?Did you guys do something to my machine over the weekend? I’m missing a bunch of shortcuts…Mysteriously, each user was missing the exact same set of desktop icons: 5 shortcuts leading to the databases located on the network.His unfamiliarity with the problem, and horror at the sheer number of emails, sent Will careening to Rita’s cube. “Ever see anything like this before?”“No,” she replied. “Does this have anything to do with enabling local admin rights?”Will frowned. “I don’t really see how. I’m not sure what it is. I’m just gonna write up a quick batch file to re-add the shortcuts and push it out to everyone.”So he did. The shortcuts reappeared, and worked perfectly. Everyone was happy. It was tedious, but Will made sure to log and close out a separate support ticket for each email he'd received, just in case he needed those blessed “metrics” later.More like ammo, Will thought. Oh well, he doubted he’d ever run into this again.Exactly one week later, the universe told him what he could do with his doubts.“Those same icons are all missing again!” Will told Rita.“OK, it really does seem like this has something to do with the admin change,” Rita said.“How?!”She shrugged and sighed. “Let’s find out.”They pored through event logs, antivirus logs, GPO lists, and logon scripts. Nothing pointed to anything.“Maybe Google is our friend?” Will proposed.A few searches later, he had the answer: the infamous Windows 7 Computer Maintenance. If there were more than 4 broken shortcuts on the desktop, it deleted them completely. No Recycle Bin, no Unused Icons folder, just obliterated. It ran its maintenance tasks once a week on startup, after the desktop icons loaded, but before the network drives finished mapping. That meant the database links were "broken,” and were therefore deleted.Windows Computer Maintenance required local administrator access to automatically delete icons off the desktop.The icons could be retrieved via system restore, but Will wasn’t about to walk dozens of people of varying degrees of computer literacy through mounting a restore point and browsing to where the shortcuts lived. He ended up writing a startup script to manually recreate the shortcuts after all the other bizarre startup processes had finished doing their thing.Again, he logged and closed support tickets for each email received. Two weeks after making everyone an admin, Rita had metrics-ammo spilling out of both pockets, but after a round of emails and conference calls, their overlords did not care.[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!
Error'd: What is this 'Right Click' You Speak Of?
"What makes this worse is that this wasn't an edge case," wrote Roger, "I only right-clicked in the body of an email."
CodeSOD: Patterned After Success
Design patterns are more than just useless interview questions that waste everyone’s time and annoy developers. They’re also a set of approaches to solving common software problems, while at the same time, being a great way to introduce new problems, but enough about Spring.For those of us that really want global variables back in our object oriented languages, the Singleton pattern is our go-to approach. Since it’s the easiest design pattern to understand and implement, those new to design patterns tend to throw it in everywhere, whether or not it fits.
Finding Closure
Jim’s mail client dinged and announced a new message with the subject, “Assigned to you: TICKET #8271”. “Not this again,” he muttered.Ticket #8271 was ancient. For over a year now, Initech’s employees had tossed the ticket around like kids playing hot potato. Due to general incompetence and rigid management policies, it never got fixed.Jim was the GUI developer for their desktop application, InitechWORKS. The app used a web browser widget to display content from the company’s web page within the application, mostly for marketing fluff. The bug itself was a tracking pixel which occasionally failed to load, and when it did the browser widget replaced the pixel with a large, unsightly error icon. Both the web page and the tracking pixel came from Marketing’s web server.Time after time, ticket #8271 landed in some luckless developer’s hands. They each tacked on a note, saying there was nothing wrong with InitechWORKS, and forwarded the ticket to marketing. And time after time, Marketing punted the ticket with a note saying, “Can’t reproduce, must be an issue with InitechWORKS, re-assigning.”And so, once again, Jim decided to talk to the project manager, a middle-aged man named Greg with the memory retention of a dying goldfish and a management style with all the flexibility of a beryllium rod three feet in diameter.“Greg, I was looking at ticket #8271. I know Marketing won’t fix this bug, but I have a quick fix to suggest-”Greg had no idea what ticket Jim was talking about, but he didn’t need to. His flexible management policy came into play. “Per company policy and the org chart, the InitechWORKS team cannot talk to Marketing.”“But they need to fix something on their end!” Jim nearly shouted, hoping to get the full sentence out before Greg interrupted him.With a sigh, Greg pulled up the ticket. His mouth moved as he read it to himself. “See here, Marketing says the issue is with InitechWORKS, not Marketing.”“But they’re wrong. It’s definitely not-”“Marketing is never wrong,” Greg said with a cold stare. “Now, go fix this bug.”Jim walked away, dejected. He knew Greg wouldn’t remember this conversation the next time ticket #8271 came up.Jim couldn’t assign the ticket to Marketing, but he added his suggested quick-fix along with the note, “Problem is with the web page, not InitechWORKS,” and moved the ticket to Greg.Later that day, Greg approached Jim at his desk. “Jim, about ticket number…”. He paused to glance down at his notepad. “… number 8271. I passed it over to Marketing, but there’s a problem.” Greg lowered his voice and became indignant. “I had to delete your comments and ‘fixes’. We can’t presume to tell Marketing how to do their job.”Jim mentally facepalmed. His plan had failed. “But it’s a si-”“They’re smart guys, and I’m sure they’ll fix it,” Greg interrupted. “You do your job, and let Marketing do theirs, and we won’t have to get HR involved with a formal reprimand.”Two weeks later, Jim’s mail client dinged. “Assigned to you: TICKET #8271” was on the subject line. He groaned, and started planning how he was going to approach the issue this time. When he went to Greg’s office, the project manager was nowhere to be seen.“Have you seen Greg?” he asked the PM in the neighboring office.“Oh, didn’t you hear? He quit this morning. HR refused to discipline one of his employees, so he quit on the spot. Said something about the company refusing to follow their own policies. And now I’m inheriting a lot of his projects, so if you don’t mind…” The PM went back to work, silently ignoring Jim.Jim glanced back into Greg’s office and noticed that Greg’s PC was unlocked and logged in. On a whim, he sat down at the computer. As a PM, Greg had special privileges, like the ability to disable the automatic computer locking, and access to pretty much any system in the company. That included Marketing’s production web server.With a little poking around, Jim found the problematic web page and its tracking pixel. He quickly implemented the quick fix he’d suggested earlier, simply styling the image to be zero pixels and located 10,000 pixels off the edge of the screen. That wouldn’t fix the loading issues, but when it misbehaved, the ugly error would stay off-screen and not hurt the page.He slipped out of Greg’s office. Greg’s neighbor didn’t even notice him as he walked by. When Jim returned to his desk, he could no longer reproduce the issue. After a painfully long eighteen months, he marked ticket #8271 as closed.[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: The New Zero
If Alice needed to rate her co-workers, on a scale of 1–10, whoever wrote this is a zero. The goal here is to create a new string that is 4096 characters long and contains only zeros. This was the best approach Alice’s co-worker found:
Brillance is in the Eye of the Beholder
“E-commerce” just doesn’t have the ring it once did. The best-qualified hackers in the world used to fall all over themselves to work on the next Amazon or eBay, but now? A job maintaining the back-end of an online store isn’t likely to lure this generation’s rockstar ninja coderz, which explains why Inicart ended up hiring Jay.As far as Colleen could tell, her boss had been trying to add a developer to their team for at least a year. Scott was always on his way to interviews, second interviews, phone screens, and follow-up Skype calls… but summer turned to autumn turned to Christmas, and Inicart’s dev team returned from the holidays to find only their waistbands had increased in size. But then came the day Colleen walked in to find the long-empty cubicle next to hers brimming with a brand-new task chair and workstation. She ran down the hall.“Scott!”“’Morning, Colleen.” The team lead was leaning back in his chair with the grin of a satisfied hiring manager.“So you… you found someone?”“That’s right.”“And they’re… good?”“Right again. He’s very good.”Colleen didn’t know what to say.“He starts next Monday,” Scott said. “You guys should get ready to do some onboarding.”Colleen flipped a mock salute, and scampered off to do just that. A new developer! This was huge: Colleen and her team might finally be able to take a break from fixing bugs and actually deliver a new feature!With all due respect to Scott’s hiring prowess, it wasn’t immediately obvious to Colleen what he’d seen in Jay. The new developer was sociable enough, joining the team at their various outings, but he wasn’t big on eye contact, and tended to wander around whatever point he was making until you just lost interest. Colleen didn’t want to write Jay off on his social skills alone, however; they needed someone to fix bugs, and pretty soon he was doing just that.Week three was when Colleen started to worry. Jay was tearing through the bug backlog, but, for a developer new to the team, the company, and the codebase, he asked very few questions. That is to say, no questions. Not wanting to be unreasonable, Colleen confirmed that her teammates were also concerned.She brought those concerns to Scott. “I mean, I’ve been on this project for years, and I have questions.”“Well, he is very good. He interviewed at Google, you know,” Scott said. “If you’re worried, though, maybe you could do a code review?”Like everything else about Jay, his changes seemed fine at first glance. His taste in variable names tended towards the unusual- booThu stuck in Colleen’s mind as one example (an abortive attempt to summon the Great Codethulhu?)- but Jay seemed to know more or less what he was doing. Then they found Jay’s proclivity for write-only properties. A bunch of classes had sprouted these strange properties, properties whose value couldn’t be accessed, properties that did weird things to the classes’ internal state, more like they were a function call than a property- it was like Jay had never learned about void methods.When challenged, Jay said, “Well, when I interviewed at Google, they thought that was a really clever design choice.” Of course, Jay may have interviewed at Google, but according to his resume, he never worked there.As the checkins piled up and the team dug deeper, worry turned into alarm. Large sections of code had vanished from the codebase. According to Jay’s checkin comments, the swaths he’d erased were “inefficient and useless”. Colleen would have been willing to argue the point about efficiency, but the missing code was better described as “handling rare but important corner cases in shopping cart processing”.Jay was obstinate when questioned about his unusual coding style. “I’m writing compiler-efficient code,” he cried. “If you don’t understand how the compiler turns your code into machine instructions, you’re never going to write an efficient program! That’s why I’ve been cleaning up your code.”The outburst that ensured Jay a place in Inicart legend forevermore took place when, in the wake of The Case of the Missing Corner-Case Code, Scott told Jay they were letting him go. After security had shown the raving developer out of the building, Scott let the team in on their final conversation.“I told him, ‘I’m sorry, Jay, but we have to let you go,’” Scott said.“You can’t do that!” Jay had replied. “I’m brilliant!”Scott had been so taken aback by this assertion that he’d been unable to stop himself from saying “Uh, no! You’re not!”Scott admitted this hadn’t been his most-professional moment. But the rest of the team forgave him: from then on, Colleen and co. had a new catchphrase whenever a teammate found a bug in their code.[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!
Error'd: Error Version 16
"I was filling out a survey for PayPal when this message popped up to let me know that I am at a testing stage," Ishai S. writes.
Bonus WTF: 5:22
No, it isn't an extended cut of a John Cage song, it's a new feature article that we put together- but you can't read it here, you can only read it over at our sponsor site: 5:22.Special thanks to Infragistics, for helping support TDWTF.A worldwide leader in user experience, Infragistics helps developers build amazing applications. More than a million developers trust Infragistics for enterprise-ready user interface toolsets that deliver high-performance applications for Web, Windows and mobile applications. Their Indigo Studio is a design tool for rapid, interactive prototyping.[Advertisement] Use NuGet or npm? Check out ProGet, the easy-to-use package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds and npm repositories. It's got an impressively-featured free edition, too!
Announcements: Experience Your Own Support Stories at Inedo
Support stories have alwaysbeenamongsomeofmyfavorite.Not enough links for you? Here, I'll just share my favorite favorite: Radio WTF Presents: Quantity of Service.It's not so much the sense of smug superiority that comes with diagnosing ID-10t and PEBCAK errors, but more a sense of appreciation. I've been there — my first grown-up job was on a helpdesk — and to this day I still handle a fair bit of BuildMaster and ProGet support inquiries. And actually, that's why I'm writing this message today.We've been growing a bit at Inedo this past year, and there was a position / job opportunity that I wanted to share with you: Support Analyst. This is not a typical helpdesk role by any means. Actually, it's a blend of roles — support, service, technical writing, and development — and since we're a small team, we'll all be working on doing all of these things together.But I thought the most interesting part about this opportunity is the Developer Growth Opportunity. From the posting:
Representative Line: Truely Representative
There’s bad code, and then there’s code so bad that you only need to see one line of code to understand how bad it actually is. Simon supplied this tiny horror which manages to combine all that’s wrong with PHP with the worst of loose typing and a thick layer of not really understanding what you’re doing.
The Batman
CodeSOD: Pointerrific
Working with a legacy codebase is like embarking on an archaeological expedition to a foreign land: you never know what ancient artifacts you're going to uncover. Will it be the mighty fast inverse square root? The rusty yet still operational Duff's device? An old COBOL module forgotten by time, quietly holding the universe together?Unfortunately for Matteo I., his escapade wasn't nearly as fruitful. Digging through the muddy codebase, all he found were horrible C++ and linked lists. Lots and lots and lots of linked lists.Now, the thing about linked lists is that they didn't age very well. Back when processors were less smart and locality wasn't an issue, they were a reasonable trade-off—but as technology marched on, new data structures were invented, and processor caches grew, the drawbacks started to overshadow the benefits. And so, they were relegated to college textbooks and old programmers' tales.Still, in the hands of a skilled programmer, those outmoded structures could still be made to perform well. Judging by the code below, however, "skilled programmers" were not a resource Matteo’s predecessors had in abundance...
Loafing Around
Mandatory Fun Day: Classic WTF: Mandatory Fun
It's hard to believe that it's been 7 years since the last installments of MFD. Mark's been too busy doing art for things like Release! to waste his artistic talents here with us. From back in 2008, I've grabbed a few of my personal favorites from the old MFD days. --Remy
CodeSOD: Classic WTF: XML Abuse
Is it still trendy to hate on XML? Of course it is! But this WTF would still be a WTF if it were built in JSON, because this is terrible.
Classic WTF: A Temporary Problem
This classic is a perfect example of what happens when you outsource IT functions. You get some short-term, temporary gains, but you'll always lose in the long run.
Tales from the Interview: Classic WTF: Trouble With Founders, the Lost Candidate, and More
I think Tales from the Interview are always a special treat, in part because we don't run them very often. It may also be because at my last job, I was notorious for once making a candidate cry and have a panic attack, but I'm an incredibly nice interviewer! I swear!
Classic WTF: Long Distance DATE$ing
The Fourth of July was this weekend, and this is the perfect time for us to have our little Summer Vacation. For this week, sit back, enjoy some nice weather along with some Classic WTFs (nice weather not guaranteed, definitions of "nice" may vary from user to user).
Error'd: A Defined Sense of Taste
"This was in the appetizers section. I wonder if they do 1920x1200 for an entree," wrote Semaj.
News Roundup: I'm Not Married to the Idea
A bit more than 15 years ago, the software industry was barreling straight into a crisis: the dreaded Y2K bug. Vital software was going to fail in odd ways, banks weren’t going to handle transactions, planes weren’t going to fly, nuclear reactors weren’t going to react, cats and dogs living together, mass hysteria, real wrath of God type stuff.The software industry rallied, software got patched, and at the stroke of midnight, not much actually happened. Over the past week, a different bug has been keeping a small pool of software developers up at night. Welcome to the world of Y2Gay.In a landmark decision, the United States Supreme Court revised the business requirements and integrity constraints on the marriage relationship, removing some legacy constraints and essentially updating to better reflect the actual needs of their end users. This policy decision now has to be implemented in every state, county, town and hamlet across the country. Every change breaks somebody’s workflow, and this one is no exception.Shortly after the decision was made, stories like this started cropping up. Making software changes, especially in an IT shop as small and disorganized as a local county office (which in many cases have only one staff member doing IT) is a uniquely challenging task. In what might be the first authentic miracle in Texas, Williamson County managed to get a software update out before a week went by.Other states are having their own rush to fix their software. St. Tammany Parish in Louisiana called their IT tech back from vacation. In the meantime, someone noticed that they still have pens in Louisiana, so they’re just printing the old forms and correcting the language by hand. Poor Denton County, Texas does not have pens, and didn’t issue updated licenses until Monday.Kentucky is another state that still has pens:
CodeSOD: Mistakes Were Made
As a general rule, “dead code” should never be commented out, but instead, should be replaced. If you ever need to review the history, source control contains that information.But sometimes, the “I’ll just comment it out” lets us see the moment of realization, when a developer discovers that they’ve done the absolute wrong thing. Clara sends us this:
Uncommon Respect
Coyne viewed the coming work week with dread. His employer spent roughly the sum of all the employee’ 401k holdings on a weeklong mandatory communications training course. The problem of no work getting done during training was solved by having mandatory after-hours work to make up for it.The training program centered around three simple tenets to holding effective meetings: Common Respect, Common Purpose, and Common Goals. Before the training started, Coyne’s manager, Stefen, made an announcement. “After completion of this course,” he said, “there will be no excuse for having an unsuccessful meeting. We’ll be tracking meeting results, and bad meetings will be documented and reviewed during your annual performance evaluations. Now, let me introduce your trainer, Trent…”Coyne knew where this was going. Meetings would be the same, but now they doubled as ammunition on performance reviews. Worse, Stefen now had three new terms to throw around, ad nauseum, when he decided to hijack a meeting and tell everyone his mandate. The training tried to make that harder for him, though, by introducing a “Talking Pillow” on the very first day.“Part of Common Respect,” Trent explained, “is adhering to someone’s right to speak.” If you started blabbering without holding the Talking Pillow, you were violating the Common Respect tenet. You could only speak if you were holding the pillow, and once you were done with your spiel, the talking pillow would be passed on so someone else could give input. Coyne and his team were forced to practice it, and most of them had no trouble with the Kindergarten exercise- aside from Stefen, who kept violating the rules.The ensuing days of training delved into the Common Purpose and Common Goals part of the program. Common Purpose could be summarized as, “Everyone should agree on the purpose of the meeting and stick to it.” Stefen gleefully tacked on an “or else!”. Ever the cynic, Coyne could already see Stefen taking this as a license to focus any meeting on what he wanted it to be about. Disagreeing with Stefen would be trampling the sacred order of the Common Purpose.As far as Common Goals, these were meant to imply everyone would leave the meeting with the same goals, consisting of a to-do list of deliverables. Anything other than concluding a meeting with Common Goals would be considered a failure. Terms like “post-meeting harmony” were thrown around to make it seem like an ideal situation.The week ended, and Trent and his fellow consultants were happy to pack up their talking pillows and take their exorbitant check for a week’s worth of work that could have fit into a one hour webinar. “Best of luck, everyone!” Trent said through a grin as he shook everyone’s hand. “I’m sure you’ve all seen the importance of RESPECTING each other’s PURPOSE to achieve GOALS, and you all have that in COMMON now!” He chuckled like this were a clever phrase, and Coyne rolled his eyes.Before the trainers were out of the parking lot, Stefen raised his own talking pillow on high and shouted, “Listen up, everyone! First thing Monday morning, we’re putting this knowledge to good use. I’m calling a 7AM meeting to discuss the strategy for the Initrode migration, so show some Common Respect and be there on time!”Most of Coyne’s co-workers didn’t usually start their day until 8 or 9. “Common Respect” apparently didn’t extend to scheduling meetings during core hours. But Coyne and his team members shambled into the conference room, zombie-like, just before 7AM on Monday. Stefen was already seated at the head of the table, with the talking pillow, and had scrawled “COMMON RESPECT, PURPOSE and GOALS” on the whiteboard.“Have a seat, everyone. Now that we’re familiar with the communication terms, here’s how it’s going to be. You’re going to respect what I have to say. The purpose of this meeting is to inform you of how we’re going to do the Initrode client migration. The goal after this meeting is for all of you to take the flat files the clients are going to send us in their database formats and convert it to ours.”Coyne glanced around the table. He, and most of his teammates had already had conversations with Initrode about the migration, and Initrode had agreed to convert most of their data into an industry-standard transmission file, which could be directly imported- no additional conversions required. None of Coyne’s co-workers objected, so Coyne slowly reached out for the talking pillow in front of Stefen. “I’m not looking for any input on this, Coyne!” Stefen yelled as he snatched the pillow away and launched it out the door.[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: We All Float Down Here…
When Maarten first saw the utility function below, he couldn’t imagine why converting a number from float to double required a string intermediate. Fortunately, whoever wrote this code followed best practices: their comment not only explained what the code is doing, it also explained why.
Error'd: What, What?
"Ah...it looks like someone is testing in Production as every link on Cleveland.com starts with this helpful alert," James writes.
CodeSOD: Practical ValiDATEion
Handling dates is difficult.On paper, it doesn't seem to be a complicated task. After all, computers are good with numbers, and what are days, months and years if not small, supposedly easy-to-deal-with numbers?But behind this deceptively simple façade lie all sorts of nasty traps. The historical baggage of our civilization means that a good programmer needs to deal with tens of different date formats, multiple calendars, leap years, leap seconds, and some dates simply going missing. One might argue that humanity should've hammered out a more unified, common system long ago — but since we're still at least two hundred years away from adopting stardates, we have to keep accounting for each and every edge case.Fortunately, we coders are a smart bunch. Most languages have a good date library that takes at least some of that burden off our shoulders. Unfortunately, this being The Daily WTF, today's specimen decided to ignore them all and reinvent the wheel, with quite a few jagged edges...
Ponderous at the Ponderosa
Depending upon how long you've been in this industry, you've seen your fair share of bad design, bad code and bad users. Darren A. explains his dealings with bad management, and how a string of edicts there-from can crush kill destroy an organization.In the past, before management decided to, well, manage, Darren's company was able to complete 15-25 major projects each year. Then they hired a new Head of Software Services, who felt that he needed to actively manage all facets of how things were done...
CodeSOD: A Convoluted Time Machine
The web team and the JDE development team rarely see eye-to-eye in Cho's company. Cho, the JDE developer, worked in a world full of Oracle databases and important financial records. Andrew, a web developer, worked in a world full of MS-SQL and sales appointments. So when Andrew asked Cho to put together a job that would remove debt records older than six years so they'd stop showing up in his sales reports, he figured she had things well in hand."Six years?" mused Cho. "I'll have to build a custom function to figure out the start and end dates... I'll get back to you."Two weeks after launch, several production incidents had been traced back to this new functionality. Of course, Cho had gone on vacation, so it was up to Andrew to dive into the seedy world of Oracle databases and debug the function...
Finally Clear
Neil’s first contributions to the company codebase were to be tested in the fires of a late afternoon code review. Donavan, a veteran of Java since 1.1, was asked to sit in.It began as a thankfully uneventful affair — but then Donavan noticed that Neil had removed the finally from an existing try/catch/finally block.“Why’d you do that?” he asked.“Well, because a finally block is indeterministic,” Neil explained.Donavan frowned, smoothing out the startled What?! in his throat into a calmer, “What do you mean?”“You never know when it’s going to execute,” Neil elaborated. “It may never execute. It also causes severe performance and portability problems. It’s not good practice to use.”“I’ve… never heard of that,” Donavan replied, patiently stowing his skepticism for the moment. “I can only think of two reasons why a finally block might not run: one, the thread executing the try/catch is halted or killed. Two, the JVM crashes or exits in the try or catch block.”“I’ve read about this before. I know what I’m talking about,” Neil huffed, folding his arms.“Where’d you read this?” Donavan asked gamely.“I think it came from a book called Effective Java,” Neil replied.“I have that book,” Donavan replied. “This is news to me.”Neil tugged at his collar. “Well, I — I think you’ll find the new code performs much better, and is safer.”“Did you run any performance tests against it?” Donavan asked.Neil’s face grew steadily redder, until he wrapped around the spectrum and approached violet. “I have fifteen years of Java experience!”The experience card? With Donavan? This guy was new, all right.“Whoa! You don’t have to get defensive about this.” Donavan put up his hands. “I just want to know why you did this, and what your source was. I’m not going to propagate this information by saying ‘Some guy told me this was the case.’ I’d like to read it for myself.”“I know it was Effective Java,” Neil replied. “Look it up, if you want!”The rest of the code review proceeded without fanfare. Upon returning to his cube, Donovan googled for information on when and why not to use finally in Java. He found nothing enlightening.Then he searched for “Effective Java finally.” There, in an online version of the book, Chapter Two made reference to avoiding finalizers, stating the exact same facts Neil had attributed to the hapless finally block.There it dawned on Donavan: Neil had either confused the terms, or he believed that a finally block was actually itself a finalizer.Donavan jumped up and checked Neil’s cube, only to find it empty. So he sent an email with the citation. I can see how the terms can be confusing, he added at the end, hoping to soften the blow.After clicking the Send button, Donavan sat back and folded his arms with a thoughtful frown, pondering the long-term effects of such an innocent slip. In Neil’s alleged 15 years of experience, how many finally blocks had he delete-keyed into oblivion?Fortunately, Neil wasn’t so set in his ways that he couldn’t correct course when proven wrong. He and Donavan had a good laugh about it the next day. And once Neil finally understood finally, they could finally program happily ever after.[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!
Error'd: Language Barriers
"'Soll das Fenster geschlossen werden?' means roughly 'Should the window be closed?'," wrote David, "Hovering over the 'No' option shows that it will invoke doNothing(). Thank goodness!"
Taxing Production Tests
As some readers already know, the Polish government is not on the best of terms with modern technology. We'd be damned, however, if that stopped us from trying- even if the end result is as much of a mess as Michał reports it to be.The story began in 2008, when the government decided it needed some presence on this new hip thing called the Internet. And so, the Electronic Platform of Public Administration Services, or ePUAP for short, was born- a website serving to ease communication between public administration and Polish citizens. It went mostly unheeded until 2011, when the Trusted Profile functionality was introduced- and with it, the ability for people to do taxes, file applications, and submit other paperwork fully online.Surprisingly, the website worked mostly fine. But soon after the first wave of interest, problems began to appear. Every update led to major downtime. Features such as password recovery would either break or have days-long delays. And, an investigation of a corruption scandal revealed that ePUAP- along with several other services- was the fruit of rather shady dealings.Michał's story concerns an incident from a month ago, when the whole system crashed and burned. Most users were unable to log in, and the lucky ones who could found that their Trusted Profiles and personal data were missing. It turned out to be a major problem for everyone who elected to do their taxes over the Internet, since the system broke down just a few days before the April 30 tax deadline. Their only other options were to wait several hours in line at their local public offices, get hit with huge financial penalties, or write formal letters to the tax department describing how sorry they were.The media caught the story, and managed to get a response from the Ministry of Administration and Digitization:The work on a new version of ePUAP is underway. Maintenance-related downtime is expected. There's nothing alarming about it. Unfortunately, the tests we do can't be fully done over weekends.Apparently, newfangled inventions such as "testing environments" haven't fully permeated the Iron Curtain. And so, this country-wide platform- holding the personal data of hundreds of thousands of people- is being tried in battle on production servers, during the year's most intense period of activity.[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: Defensive Programming
Marino was handed this code. Like all great code, it’s written defensively, protecting itself against nulls, empty strings, and other unexpected values.I mean, sort of.
Paying Cache for Insurance
If you asked the web developers at XYZ Insurance, a mere network engineer like Billy had no business snooping around in their code. “He probably doesn’t even know what HTML stands for,” they’d sneer, and they kept sneering until a routine change to fulfill an audit requirement brought their internal website grinding to a halt.
Best of Email: Best of Email: Super Spam Edition
Next time you get an unwanted email, before you kick it into the bit-bucket, give it a quick read through. If it makes you go "WTF?!", kick it our way instead. We love 'em!What's in a name anyway? (From Chris)Mr. LName (or FName as his friends call him) sure are racking up a lot of bills on my email.
Error'd: Helpful as Ever!
"One very helpful error, followed by another, and then Oracle Forms Designer crashed," Owen C. wrote, "I suppose at least it made an effort to tell me something was wrong!"
The Daily WTF: Live: The Worst Boss Ever
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 final story is another one of my own, and this one is about… the worst boss ever. I mean it, and in this story, I can prove it. This is also arguably my first interaction with a real WTF.Direct Link(MP3)This episode is brought to you by our sponsor, Puppet Labs. Check out their intro video, it gives a pretty good overview of how they help their customers get things done. Start a free trial today!This brings our season of TDWTF:Live to a close. I had fun hosting and recording these stories, and I hope you had fun listening to them. Next Thursday will return to your regularly scheduled WTFs.And since Paula is freaking out at the moment, pop over here for the comments.TranscriptAt the Daily WTF, there’s one kind of story we get a lot of submissions for that we don’t often run, and these fall into the category of what I like to call a Bad Boss Story. There are three reasons we don’t run bad boss stories. The first one is you never really know if it’s truly that this boss was a terrible boss, or it was just somebody that has sour grapes. ‘Cause sometimes, you read them, and you’re like, ‘You just didn’t like the guy. It’s not that you had a bad boss, you just didn’t get along.’The other reason is that there’s nothing IT specific about any bad boss story. Everybody’s had a bad boss. Raise your hand if you’ve had a bad boss. Pretty much everybody. And that’s one of the other reasons we don’t run them, there’s nothing IT specific. But the main reason we don’t run a lot of bad boss stories, is because I had the worst boss.And I can prove this, and I’m about to in the next couple of minutes, I’m going to prove that I had the worst boss.My story starts a little bit like Mark’s. I was graduating college and it was just around the DotCom bust. And I did not want to, after graduation, go home and live with my parents. I was very, very opposed to this. I happened to have some friends who were generous enough to let me impose upon their closet. I lived in their closet for about six months, so I really wanted a job. I was not very picky about the job, there was nothing really going, so as soon as I found a job- and it was an IT job. I was doing stuff with Word and Excel, not programming, but it was an IT job. Y’know what, it’s an IT job, I’m going to take it, and I don’t care about any of the details.And that was my first mistake.So, I walk in on the first day, and the Big Boss, Tom, the owner of the company is there to greet me. And I’m kinda overwhelmed almost instantly by Tom. Because first, Tom was so orange that Tropicana has sued him for trademark infringement. It wasn’t just, like the bottle-tan, Jersey Shore orange, because he had grey hair, and he wanted to ensure that he didn’t have any seams, so he would work the tanning lotion into his scalp, so he had this fringe of orange hair all the way around.And that was just the first thing you notice. The second thing you notice is that he’s a very grabby boss. The very first thing he does is slap his hand on my shoulder and give it that… squeeze. “Hows everything GOING?” Ugggghhhhh.But everything was going pretty well, because I had a job, and in a couple weeks I was going to be getting a paycheck. Everything was going well. I was enthusiastic.I learned, very quickly, Tom was not- as much as he pretended to care (How’s everything going, SQUEEZE SQUEEZE SQUEEZE) he didn’t really care about his employees. So, when he needed you to work two weeks straight, 16 hour days, you were 16 hour days for two weeks straight. There was no compensation. There was no buy you a pizza. He didn’t buy you dinner. You just did that, because that was your job.And again, I was still kinda happy to have a job, so I would drag my ass in at 7 in the morning, and leave at around 10 PM at night, and I’d do that for two weeks straight, three weeks straight- no, actually, after the third week, I needed to travel to a different location, so Friday night after the third week I get Saturday, but then Sunday I have to go drive ten hours away to the other side of New York State, which is where this was based.So, that’s the next thing I learned about Tom. But y’know what? That’s still not why he’s the worst boss I ever had.I learned a few other things about Tom, over time. First off, Tom didn’t have a good sense of where he was at any given moment, or what his purpose there was. One day, I’m sitting in the break room with one of my co-workers, and Tom comes in- and he bursts, he just explodes into the room, full of energy. There is a reason why he has come into the employee break room. He is looking for someone, to tell them something, and he bursts in, and he’s about to do it- you can see him winding up, you can see the gears turning. Then he looks at my co-worker, and he looks at her tights, which have this check pattern on them, and he says, “I just want to play tic-tac-toe on your legs.” And then he turns around and walks out. And we just take a long moment, I look at Paige, she looks at me, and we ask, “Did that just happen?” and the answer is yes.Later that day, I was getting a cup of coffee and all of the sudden, THUMP “How’s everything going?” Ugh.Little later than that, we actually learned another fact, didn’t know it at the time. Tom, and his wife- who worked there, she was actually the Vice President- always a sign of a healthy company- they were swingers. And they did invite some employees to some parties at points. They did invite some employees to parties at points. I don’t know whether to be happy or insulted that this never happened to me, but y’know? None of that is why Tom was the worst boss I ever had.Tom was the sort of boss that really loved to have pep talks. Every Friday, at 4:30, you did not go home, you went to the mandatory meeting. There was no excuse that would get you out of that meeting. There was no excuse that would get you out of that meeting. If you called in sick that day, you couldn’t get out of that meeting. He really wanted to give you your pep-talk. And his pep-talk were absolutely content-free, but you also learned another thing about Tom.Friday, at 4:30, Tom would be dragging ass just like the rest of us. You’d see him in the hallway and he wouldn’t go “THUMP How’s everything going?” He’d be, “eh”, it’s Friday, at 4:30. But right before the meeting, he’d go into his office and close the door. And then the door would open, and (sniffling sound) he would come out and he was READY TO PEP YOU UP.But Friday at 4:30 coke fueled meetings were not why Tom was the worst boss I ever had.One day, I come into work, and Tom’s not there. Which, is actually a pretty good thing. Everybody’s pretty happy about that. Nobody’s upset that Tom’s not there, until Chris, the Ops Manager, starts running around frantically to everybody. “There’s a meeting during lunch, and you HAVE to be there. Don’t go to lunch, doesn’t matter if you didn’t think to bring a lunch, you HAVE to be at this meeting.”I’m like, “Oh god, what’s Tom gonna do to us now?” Well, as it turns out, Tom wasn’t going to do anything to us, because Tom had drained the company’s bank accounts, run off to Connecticut, left about two dozen contracts unfulfilled, and was being hounded by lawyers. The content of this 12 o’clock meeting was “We don’t know where Tom is, we don’t know how to get in touch with Tom, but if Tom contacts you, let us know. The State Troopers would like to have a conversation with him.”And that’s STILL not why Tom was the worst boss I ever had.If we rewind just a little bit, keep in mind I was just happy at this point to have a job, but if we rewind just a little bit… One day, I’m standing at a urinal, going to the bathroom, as one does, and all of the sudden…THUMP SQUEEZE SQUEEZE SQUEEZE. “How’s everything going?”There’s so many witting things that you can think of after the fact, that you could have said or done in that situation, but when it actually happens to you, everything just shuts down. EVERYTHING shuts down. You just stop. You wait for it to be over. You wait for Tom to leave. You wash your hands. You just… cry briefly. And then you remember, at least you have a job.[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: Making Progress
Whenever a program needs to perform a long running process, it’s important that it supplies some sort of progress indicator, so the user knows that it’s running. Sometimes it’s a throbber, a progress bar, an hourglass, or the infamous spinning beachball of death.
Announcements: Last Chance to Back Programming Languages ABC++
As most of you know, this last month I have been running another Kickstarter campaign, Programming Languages ABC++: an alphabet book all about programming.In the same spirit as Release!, and The Daily WTF, this project focused on the culture that surrounds our day jobs. Specifically in this case, it was all about getting kids interested in what we do.It turns out that a lot of people were pretty into the idea. We hit our goals in under 2 days, and for the last month have hit every stretch goal we set within hours of posting them.We still have through Thursday to drum up as much support as we can, so please check it out, and share it with friends.I wanted to put one last plug here because I am genuinely proud of this little book. I think it will really do its job and help to get kids excited about the idea of growing up to be a developer. Plus, I think it would make a pretty cool coffee table book for grownups too.Thanks so much,Alex[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!
The Software Developers Who Say Ni
Tim, the Hardware Enchanter worked at a small hardware/software company which made specialized instruments for a variety of industrial applications. When he wasn’t busy blowing up the English countryside, he designed hardware as well as its firmware- a mix of C and assembly code- which had to fit into 32KB of program memory with 2KB of RAM. He hardly ever touched application code, and was happy with that arrangement.The company’s next product was The Probe. It was a device for measuring and testing other hardware, and its data went to a PC for further analysis. Tim helped design the hardware and wrote most of the firmware, then waited on the software team to make the controller application.And waited. And waited.Finally, he went to speak with the head of the software team, a disagreeable man named Roger. “Who are you?” the man grumbled, obviously upset at his work being disrupted.“There are some who call me… Tim?”“And what is your quest?”“I need your software for The Probe so we can finish testing on the hardware end,” he answered.“Yeah, well, we’re busy,” Roger said gruffly. That wasn’t the response Tim was expecting.“Well, when will you not be busy? We need this software.”Roger adjusted the arrangement of his keyboard and mouse on his desk before harumphing. “Listen, those of us who arrange and design applications are under considerable stress at this period. We have a lot to do and not enough manpower to finish it all.”Tim bit back an expletive, “Well, put it on your list. I’ll throw together something quick to finish hardware testing, but we need you guys to come up with something nice before this sells.”Roger didn’t even respond, and got back to the work of rearranging things on his desk. Tim went back to his office and got to work. He wasn’t really an application-software guy, but he was able to hack together something with a GDI+ GUI to communicate with The Probe. It was ugly, slow, and crashed a lot, but was good enough to complete the required hardware testing. He moved onto other projects while waiting for the software guys to do their job.And so he was quite surprised when, several months later, a customer bought The Probe in bulk, and the Powers That Be demanded immediate shipment. “We don’t even have software written for it yet!” Tim protested.“Roger told us that you wrote the software and it was all ready to go.”“What? No!” Tim was astounded and started shaking his head. “I wrote an application to test The Probe’s hardware interface, but it’s just an internal tool. It’s the most foul, cruel, and bad-tempered application you ever set eyes on!”“Does it work with the hardware?” they asked.“Well, yes…”“Then we’ll ship it. We need this sale. It’s Antioch Industries, and once they buy it, everyone else in the industry will be falling over themselves to upgrade, too.”Tim started to protest again, but The Powers That Be turned to the Release team. “Go on Bors,” they said, “Package a release.”“Right! Silly little bleeder. One shipped product coming right up.”And so, his slow, unwieldy, segfaulting GDI+ application was burned onto a CD, labeled with sharpie, and packed into a box with The Probe. The kaboodle was shipped off to Antioch, like an unholy grenade, waiting for the customer to pull the pin…… and when it finally did go off, all Tim could say was, “I warned you, but did you listen to me? Oh no, you knew, didn’t you? Oh, it’s just a harmless little piece of software, isn’t it?”[Advertisement] Use NuGet or npm? Check out ProGet, the easy-to-use package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds and npm repositories. It's got an impressively-featured free edition, too!
CodeSOD: Required
Managing namespaces in JavaScript presents its own challenge, since the language’s default behavior is to start slapping things into window. For this reason, people have built a number of libraries and practices to solve this problem.Jared’s company, for example, uses RequireJS to load dependencies, like the lodash utility-belt library. Sadly for Jared, their new hire proved that all the module-loading libraries in the world don’t solve incompetence.
Error'd: You've Been Warned!
"This warning comes highly recommended!" writes Sean H.
The Daily WTF: Live: Building a Better Person
On April 10th, I hosted The Daily WTF: Live! in Pittsburgh. It was a blast. We had a great crowd, and some great performances.Seth is a long-time reader of The Daily WTF, and manages to be "all over" the local tech scene. I've met him at a few TDWTF meetups, but also seen him at Code & Supply events. And today's story features robots, so what's not to love.
Announcements: Sponsor Announcement: Infragistics
A few months back, Alex announced our sponsorship program. This has been a great partnership that’s helped us bring you our regular content, but also special features like TDWTF: Live.We’re proud to introduce our second sponsor: InfragisticsA worldwide leader in user experience, Infragistics helps developers build amazing applications. More than a million developers trust Infragistics for enterprise-ready user interface toolsets that deliver high-performance applications for Web, Windows and mobile applications. Their Indigo Studio is a design tool for rapid, interactive prototyping.Infragistics tools allow you to create rich desktop apps in WPF or Window Forms, responsive Web apps in HTML5, JavaScript & MVC, and native mobiles apps for iOS, Android and Windows Phone. Their products are used by companies like IBM, Intel, AT&T and ESPN. Later this year, we’ll do a deep dive into their products.Thanks to the support of Infragistics, we’re going to be able to bring you some exciting new content, arrange more meet-ups, contests, and have more fun all around. To build amazing apps of your own, download a free trial of Infragistics Ultimate today. See for yourself why they're considered the worldwide leader in user interface and user experience development controls.[Advertisement] Use NuGet or npm? Check out ProGet, the easy-to-use package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds and npm repositories. It's got an impressively-featured free edition, too!
CodeSOD: Sleeping In
Rebecca inherited some code that’s responsible for gathering statistical data from network interface. It was originally written a decade ago by one of those developers who wanted to make certain their influence was felt long after they left the company.The code was supposed to write to one of two log files: a “quick log”, with 2-second resolution (but only for the last minute’s data), and a “full log”, with 1-minute resolution.Unfortunately, it would often fail to do anything with the full log. Frustrated that this code- which had lived in a shipping product for over a decade- was so unreliable, Rebecca dug in to see what the problem was.
Welcome to the Real World
“You should get some real-world experience.”D.H. was in college to study video game programming, and his professors encouraged him to find an internship. “The real programming business is nothing like these university assignments.”
CodeSOD: The Busy Little Boolean
Booleans! What can you say? They're deceivingly complex features of any language, and only the most proficient among us is capable of using them properly.Miss M. discovered that one of her cow-orkers found a new way to get the most mileage out of a single boolean variable named count in a single method to see if:
...52535455565758