Feed the-daily-wtf The Daily WTF

Favorite IconThe Daily WTF

Link http://thedailywtf.com/
Feed http://syndication.thedailywtf.com/TheDailyWtf
Updated 2026-05-07 11:01
Tales from the Interview: The Triple Threat
Interviews are bidirectional in that you are supposed to be culling as much information about the prospective team, co-workers and management as possible, in the same way that they are trying to size you up.There are all sorts of interviewing styles; the reasonable back-and-forth conversation that actually allows you to learn about each other, the written test to see if you can do a ten line program that you had as a homework assignment back in CS102, the keep-guessing-until-you-come-up-with-the-solution-I'm-thinking-of torture test, and so on. However, this tale centers on an interviewer trying so hard to come up with the perfect question, that not only was unanswerable, but there was no way for the interviewer to judge if any answer given was correct.Adam had an interview for a developer position with a cable and networking company a while back. It was a fairly standard interview; three guys asking various questions ranging from past experience and schooling to technical questions. They did however seem to have a problem with his degree. You see, Adam had a Bachelors of Science with three majors. Yes, three majors; Math, CS, and English. Normally people are either surprised or impressed, but never before nor since has he actually been questioned about it so thoroughly.It seems that none of the three people that interviewed him believed that he had three majors. They seemed to think that he had a major and two minors, or a major with two focuses. They grilled him a little about how many and which classes he had to take to get these "majors". So he was really a math guy that took a few programming and English classes right? Every few questions, the topic circled back to his majors.Although he was able to answer their technical questions, it should have been clear that having a CS major qualified him for the job, but they seemed obsessed to make sure that he had really had three majors.Finally, one of the guys dropped what has come to be known as "the bomb" on him. It was by far the single most ridiculous and impossible question anyone has ever been asked at an interview. They had received his resume a few days before, and apparently liked it. The interviewer told Adam that it took him a few days to come up with a question to really find out if he really did have three majors, and then let fly with his ultimate creation:
CodeSOD: Hero on the Half Shell
Melissa’s co-worker needed to write some Python code to kill an external process. There are some third-party modules, like psutil that can solve that problem, but companies like Initech tend to put lots of obstacles along the path of bringing third-party code into your applications.Without third-party tools, you’re stuck “shelling out”. Using built-in Python functions like os.system or the subprocess module. This lets you run commands like ps and kill from inside of your Python program. It’s inelegant, but it works just fine. There’s certainly nothing wrong with it.Melissa’s co-worker saw the inelegant solution, and said to themselves, “Can I make that more ineleganter?”This code searches for every process that’s a “server” for their application, and then kills them.
Thrilling Tales of Software Development: The Eighth Man
Today, we bring you another hastily-drawn, stick-figure video that recounts a true tale of requirements gathering and software development. Remember: gathering requirements is hard.
CodeSOD: Random Ruby
Peri, the new intern, was proving her worth as a programmer rapidly. She was great with finding clever solutions to problems, and she didn't bother the more senior devs too often while doing it: a boon, as they were trying to get their own work done.So when Steven assigned her a simple task—generate some unique IDs for repeated dynamic elements so the automated test team could keep track of which ones were which—he figured she didn't need any hand-holding."Good news!" she reported a few days later. "I completed that task you assigned me easily, ahead of schedule, and in only a single line of code." She preened, clearly proud of her work.Steven, who had long since moved on to other things, smiled at her. "That's great, Peri! I'll get you another ticket in a few minutes, after I approve your pull request."Peri skipped away happily.Steven finished the line he was on, pulled up Stash to skim over the PR—and stopped short.You see, the thing about Ruby is that you can do a lot in a single line of code. It's very compact and expressive that way. So when Peri said she'd written only a single line, well ...
Error'd: Questionable Judgement
"Definitely memorable, but I'm not so sure about the question," writes Shish.
CodeSOD: Authorized Users
“Hey, since Jack quit, you could add Jane to the investigation users?”William M supported one piece of a large, complicated intranet application used by auditors as part of investigations into “events” within the organization. The overall audience is small, and the purpose of the application is mostly to document the process of the investigation. Since it’s so niche, it doesn’t even have a screen for managing user accounts- the users raise a ticket and rope in developers to manage it.The developer in charge of the secure portion of the application- Rick- was busy, so William caught the ticket. He wasn’t sure what to do, so he shot an IM over to Rick.“Oh, it’s easy,” Rick replied. “Just update Jack’s record with Jane’s user info. That’s the easiest way, since Jack quit.”That didn’t seem like a smart process, but William was in a rush and this was Rick’s baby, so he just followed instructions and closed the ticket. Jane re-opened the ticket- she couldn’t access the audit compliance tracker. Jack had never used that page, but Jane planned to.Rick was still busy, so William decided to take a look at the authorization process. He found this code in the main-menu screen of the application.
Website Hacker
An investment bank had just completed development on a new digital retailing platform. Daniel was assigned to a cross-functional automated test team, gearing up to test the platform's web application—or at least trying to. Charlie, a veteran manual tester from QA, had been vocal in his opposition."Automated tests need to be tested themselves, which means the testers need to test the tests, so automation doesn't save anything. If anything, it creates more work! Besides, we should always be striving to recreate the user experience as closely as possible!"Daniel and the other developers insisted that manual testing was valuable, but automation needed to happen too. The conflict marched up the org chart, culminating in a meeting with Charlie's boss, Daniel's boss, their bosses, their bosses' bosses, all the way up the org-chart to where these branches of the organization finally joined.The verdict was handed down. Charlie was appointed the leader on testing the web application, running through the same test cases in a manual fashion to catch any problems that fell through the cracks.The team—developers, QA, and a tech lead—all abandoned their cubes to huddle together in a large conference room. Everything went smoothly until one afternoon, when Charlie piped up with the nervousness of one staring down a cobra poised to lash out."Fellas? I don't know how I did it, but I hacked into the website somehow. I see all of the code."The people seated closest to him glanced up from their work to trade frowns."What do you mean?" Daniel asked, glancing across the table at Charlie."I'm in the browser, and I can see all of the code!" Charlie explained. "I've hacked into the website. I see stuff like, 'div class equal sign—'"In other words, the HTML source. Those who were listening in burst into relieved laughter, prompting everyone else in the room to quit their work and pay attention to the faux emergency.The far more patient tech lead bit her bottom lip to hide her grin. "Charlie, it sounds like you opened the developer tools in Chrome by accident. Press F12, it'll go away."Charlie hunted down the key and pecked it with a single loud stroke. "OK, it's gone," he said as though he’d just diverted a nuclear strike. His gaze swept over the room with a mix of urgency and confusion. "I'm still really concerned. That shouldn't happen!""It's supposed to do that," Daniel explained. "Go to any website you want, you can do that on any of them.""What?!" Charlie flipped to a different browser tab, then pressed F12 again. "What?! No!"Another burst of laughter drowned out his concern."Check out the leet haxxor here," one of the developers cracked."Step away from the computer, Charlie, before you hack the whole Internet!" another developer commanded, pointing a finger-gun at the hapless tester."Charlie, it's just—" Daniel tried to say."We can't keep using this browser!" Charlie declared. "I'm raising a defect for this!""All browsers have something like that for debugging purposes," Daniel explained. "It's not just Chrome."But as the giggles continued around him, Daniel's plea seemed to fall on deaf ears. Charlie tabbed over to their bug tracker and took to some furious hunting and pecking.Daniel shook his head. Let Charlie log his defect if it made him feel better. Surely no one would take it seriously.Unfortunately, QA heads and project leads took "security threats" very seriously. The conflict escalated up through bosses, bosses' bosses, and eventually, the verdict was handed down. To avoid exposing code to users, further web development and testing involving Chrome was suspended company-wide.[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: Safely Configured
Configuration files are, well… files. File operations are “risky”- there’s a lot of reasons why they might fail, and we have to be prepared to handle those execptions.For example, maybe you’ve written an application that reads a configuration file at launch. If, for some reason, it failed to load that config, you’d need to deal with that. If the configuration were just some minor settings, you might choose to fallback to some reasonable defaults. If, on the other hand, the configuration contained important security settings, you would probably want to quit the application, or maybe fallback into some “safety” mode.Patrick U. assumed that was how the NodeJS application he was working on behaved. Then, one of his fellow developers pushed their latest release into production. He went to log into his admin account, and found his password didn’t work- because it had been mysteriously changed to the incredibly insecure “admin”. After a little poking, he found someone had left off a closing-quote in their JavaScript configuration file, and that solved the problem. But why did his password get changed when the config file was broken? Well, this code was responsible for loading the file:
A Laser Storm of Family Fun
Ben was half of the two-man IT department at Bob’s Family Fun Center. It was a popular local place for kids and adults alike to come get wild in go-carts, blast each other in laser tag, and spend copious amounts of tokens to win cheap plastic crap with tickets from arcade games. Bob the owner employed his nephew Ted as the “head of IT”. All it took to qualify Ted for the job was helping Bob out with a home computer problem once.Ted didn’t actually do a whole lot around the Fun Center, but he complained to his uncle enough to hire some help. Ben was fresh out of college with a networking degree, Ben figured he’d get some real-world IT experience at the Fun Center while maybe getting some free go-karting out of it.Upon starting, Ben was intrigued by the network setup Ted had. While strange, it worked. The network had to support the handful of office computers, point-of-sale terminals, a printer, the free customer wi-fi, and a system known as “Impale” that handled all the debit card transactions on the games.At the heart of everything was an excessive-overkill Dell enterprise server in a wooden rack Ted proudly built himself. “Pretty cool, huh?” Ted asked as he showed off his handiwork to Ben. “I spent so much of the budget on this beast of a server, I didn’t have enough left over for a proper rack. So I took matters in to my own hands!” The rack was clearly constructed out of leftovers and scraps from the plywood obstacles installed in the Laser Tag arena, and it wobbled worryingly when anyone walked past.“Sure, Ted, that’s great…” Ben lied as he deduced that even a 1000 person laser tag match with 50 categories of stat tracking couldn’t tax this server. As for the rest of the network topology, that was apparently a budget afterthought as well. The ISP line came in to a small, aging 10/100 router that in turn ran to an equally old switch. A cable in the switch ran to one of the server’s NICs. Everything but Impale depended on this router and switch for network connectivity. The other NIC on the server ran to the dedicated Impale server, which had all the games and registers talking to it. It was certainly not an ideal setup, but it sufficed.One Monday, Ted came in to tell Ben that his uncle was complaining about the Fun Center’s phone service at a family gathering over the weekend. Looking to be helpful, Ted came up with a solution, “You see, Ben, I devised a way to cut the phone company out of the equation completely! I heard about this thing called Voicing on IP, or VOIP. We can cut our phone lines, and do all the calls over the internet!”“Uhh, yeah. It’s actually Voice over IP,” Ben corrected him. “I’m familiar with that. If you want to utilize that I can help get it set up.” Ben gave their ISP a call that afternoon and scheduled a tech visit for the next week.The tech predictably arrived towards the latter part of his estimated 4 hour window. Ben and Ted escorted him to their “network closet”, which was really just a small closet that housed their IT equipment as well as a helium tank for blowing up balloons. The tech started running a line for the phone service when he came across the router it was to be hooked in to. “Well now, that won’t do,” he observed. “That router’s older’n dirt. So’s that switch. Won’t support them blazin’ speeds we got. You gon’ have to git a new’un.”Ted began to get upset at the thought of old Uncle Bob taking the “fun” out of Fun Center if they didn’t get the phones upgraded that day, like he’d promised. “There HAS to be something we can do! What if we run out and get a new router right now??”“Now son, I gots more appointments to get to,” the tech said, eager to leave. “Tell ya what. Since y’all seem like smart guys, I’ll leave this here cable for ya,” he handed the loose end to Ted.“ Go’n get yer new equipment and plug this sucker in along with the rest of them devices and you’ll be good to go!”“I got this!” Ted shouted, before he ran away to the front counter. The tech saw himself out before Ted came back with a wad of cash he took out of one of the front registers. “Ben! Run to Best Buy quick and get the finest router you can afford with this. Bring it back and I’ll get us hooked up and my uncle will be pleased when we have our phones on the internet!”“Um, Ted. You do realize we need new phones that support VoIP too? We can’t just use these old analog ones,” Ben informed him.“Crap! I’ll be right back!” Ted exited again, and returned with another wad of cash. “Get some phones too! Now go!”Two hours later, Ben returned with the gear. “Good, you’re back!” Ted greeted him in the parking lot. “You go get the phones set up, I’ll take care of the router!”Ben did as ordered. He went around and disconnected the old phones 1 by 1 and got the new ones ready to connect to the WiFi. As he was installing the last one at the front counter, he noticed the touchscreen register was frozen. He tried using it to no avail, so he did a hard reboot. It came back up but froze again. The other registers exhibited the same behavior. A mother suddenly came from the game room with her crying kid in tow. “This place is terrible! None of these games work right! They don’t do anything when I swipe my card! You’ve ruined my son’s birthday!”The lady stormed off just as Ben realized that all these problems had to be related to what Ted was doing. He ran to the back room to find Ted sitting there admiring the new gadgets he hooked up. “All set, Benny! Are the phones ready?”Ben ignored Ted as he saw the network/helium closet lit up like Christmas with constantly blinking lights on every port. The Impale server, normally almost silent, kicked its fans into full gear. The PC they used to administer Impale was frozen solid like the registers. “Ted! What did you do???” Ben questioned, starting to panic.“What? I did like the guy said. Plug the cable in to the new router, then plug in all the other cables.” Ben quickly inspected his work. He started tracing each cable to where it ran, when he made a gruesome discovery. Somewhere in the shuffle, Ted ran not one, but two cables from the router to the switch. This caused a massive broadcast storm that crippled anything connected to the network. Ben quickly removed one of the cables and everything started getting back to normal.Ben tried explaining to Ted what happened but it went in one ear and out the other. “Whatever, Ben. It’s working now. Let’s go play some laser tag!” Ted didn’t seem to care that he temporarily turned Bob’s Family Fun Center in to Ted’s House of Horrors.[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!
Error'd: The Errors Mean that it's Working
"After all, it's the courage to install that counts," writes Aaron
CodeSOD: Unselected
In the movie Man of the Year, Robin Williams plays a Jon Stewart-esque comedian who runs for President of the United States. He wins the general election due to a programming glitch in some e-ballot machines deployed nationwide.In Belgium, as Adrien F. can attest, this very nearly happened.The city of Brussels has used electronic voting since 1994. Delacroy Europe implemented the first electronic ballots for the city; the firm developed their e-ballot program in C, which ran on floppy disks and stored votes on plastic cards using magnetic strips. Every year the firm would introduce little tweaks to make their system easier to use, but it was showing its age.On May 25th, 2014, Belgium held elections for many EU and national parliament seats, as well as some local contests. The next day, election officials noticed some irregularities with votes cast in Brussels using Delacroy Europe’s program.About 2000 votes had to be voided, as they contained multiple votes for the same office from different parties (called ‘lists’ in Belgium). It wasn’t enough to sway any one election, but the media had already caught wind of the potential voter fraud. Adrien’s company was hired for an independent code review of Delacroy Europe’s voting program to determine if anything criminal had transpired.First, Adrien ruled out users manually rewriting data to the magnetic strip on the ballot card. It would require a credit card reader, which would have been difficult to smuggle into a polling place, and unlikely to happen on the scale of 2000 ballots or so. He suspected the problem was in the code.He noticed something strange in the UI selection functions, triggered when the user selects a candidate on the viewscreen. Parliamentary ballots were organized by lists that a user picked from. Cand_Check_Selection() determines if a candidate was checked, and if so, whether to select or unselect them (either Cand_Select() or Cand_Unselect()).
Overpowered
Mike had a different perspective on wiring and cable management- because he worked at a factory which made wires and cables. It was the early–90s, and he was in charge of babysitting a couple of VAXes and their massive, 85lb hard drives. It was an easy job: the users knew the system and needed very little support, the VAXes were practically unstoppable, and the backup battery system could keep the entire thing running for over an hour.The computers supported HR and accounting, which meant as the year ticked towards its end, Mike had to prep the system for its heaviest period of use- the year end closing processes. Through the last weeks of December, his users would be rushing to get their reports done and filed so they could take off early and enjoy the holidays.Mike had been through this rodeo before, but Reginald, the plant manager, called him up to his office. There was going to be a wrench in the works this year. Mike sat down in Reginald’s cramped and stuffy office next to Barry, the chief electrician for the plant.“Our factory draws enough power from the main grid that the power company has a substation that’s essentially dedicated to us,” Reginald explained. “But they’ve got a problem with some transformers loaded with PCBs that they want to replace, so they need to shut down that substation for a week while they do the work.”The factory portion was easy to deal with- mid-December was a period when the assembly line was usually quiet anyway, so the company could just shift production to another facility that had some capacity. But there was no way their front-office could delay their year-end closing processes.“So, to keep the office running, we’ll be bringing in a generator truck,” Reginald said. “And that means we’re going to need to set up a cut-over from the main grid to the generator.”From the computer-room side, the process was easy, but that didn’t stop Mike from writing up a checklist, taping it to the wall beside his desk and sharing a copy with Barry. Before the generator truck arrived, he’d already tested the process several times, ensuring that he could go from mains power to battery and back to mains power without any problem.The generator truck arrived a week before the changeover. The electricians ignored it for a few days. Just as Mike was starting to get worried about deadlines, he looked out a window and saw a trio of electricians, lead by Barry, starting to connect cables to it. Later that day, when Mike left to go to lunch, he walked past the generator truck, and noticed something odd about the cables- they were clearly single phase power cables.Typical residential power systems are single-phase alternating current- one peak, one trough. This creates “dead” moments in the cycle, where no work is being done. That’s fine for residential use- but industrial systems need three-phase power- three offset AC cycles that, when added together, guarantee current is always flowing.“Hey,” Mike said to one of the electricians loitering near the truck, “you’re planning to run some three-phase cabling, right?”“Nope. The factory’s shut down- this thing is just gonna run lights and heating.”“And computers,” Mike said. “The hard drives need three-phase power.”“We’ll have to order some parts,” the electrician said.A few more days ticked by with no three-phase connections, and Mike checked in with the electricians again.“The parts are coming.”At this point, Reginald came down from his office to the computer room. “Mike, Barry’s telling me you’re being a disruption.”“What?”“Look, there’s a chain of command,” Reginald said. “And you can’t tell the electricians how to do their job.”“I’m no-”“From now on, if you have any concerns, bring them to me.”The day of the cut-over, the three-phase cabling finally arrived. Barry and his electricians quickly strung those cables from the generator. Mike wasn’t exactly watching them like a hawk, but he was worried- there was no way they could test the configuration while they were working so hastily. Unlike single-phase power, three-phase power could be out-of-sync, which would wreak havoc on the hard drives. He thought about bringing this up to the electricians, but recalled Reginald’s comments on the chain of command. He went to Reginald instead.“Mike,” Reginald said, shaking his head. “I know you computer guys think you know everything, but you’re not an electrician. This is a factory, Mike, and you’ve got to learn a little about what it’s like to work for a living.”Now, the electricians and Mike needed to coordinate their efforts, but Reginald strictly enforced the idea of the chain of command. One electrician would power on the generator and announce it, “Generator’s running.” Another electrician would relay this to Barry: “Generator’s running.” Barry would relay that to Reginald. “Generator’s on.” Reginald, finally, would tell Mike.
CodeSOD: Keeping Regular
Regular expressions can create new problems. Like an industrial drill, they’re extremely powerful- and potentially destructive. They’re expensive, they’re cryptic, but can be extremely concise.For example, Jessica is reimplementing some C# code written by another developer. This developer was never interested in being concise, and instead favored being “clever”. For example, this developer had an array of strings, and needed to remove any non-word-characters from each string.A regex-based solution might include something like “[^\w]” which is obviously incomprehensible nonsense that no one could be expected to understand without piles and piles of documentation.Jessica’s co-worker wrote something far more… elegant.
Just Check The Notepad
As the last deployment script ran to completion, Michael sat back in his chair and let out a small sigh of relief.He knew nothing could go wrong. After all, he'd rehearsed every step of the process hundreds of times during the last six months. But deploying his projects to production always made him as nervous as a highschooler before a drama club premiere.However, the rollout was nearly complete, and Initech's Hyderabad branch was all set up and ready to enjoy their new, polished and improved inventory management system. All that was left was to log into the application for the last sanity check and celebrate the success with his team.Michael opened the browser, typed in the server address and hit Enter, expecting to see the familiar portal.Instead, a standard, white-and-red ASP.NET error page stared back at him.A few minutes of digging around the Hyderabad servers exposed the problem. While all the local applications were configured to use Windows logins to connect to the database, the overseas branch used simple SQL Server authentication with a constant login and password. After a bit of back and forth, Michael was armed with contact information to Hyderabad's database administrator, and set off to resolve the issue.Hi, it's Michael from Initech Seattle, he typed into his Lync window. Can I get a database username and password for the inventory management application?A few minutes later, the reply arrived. Expecting just the username and password, Michael was ready to say thanks and get back to fixing his problem ... but the DBA had a different idea.Sure, just check the Notepad on the server.You mean a text file? Michael responded, somewhat confused.Yes, it's open now, just check your screen.Michael went through all his open Remote Desktop sessions, but none of them had a single text file open. The only programs running were the ones he'd started himself.I don't see it, can you tell me the filename and the directory? He decided to play along. After all, maybe there was some security-related reason why the DBA couldn't send the credentials over IM.It's in the Notepad, the DBA responded. Just check it.No, it's not! Michael was growing a bit irritated. He took the screenshots of both the database and application servers' desktops and attached them to the message, hoping that would finally convince the DBA he wasn't going crazy.After a long while, the DBA finally wrote back. You're on Remote Desktop. That's different. Can you just use TeamViewer?"Are you serious?" Michael asked out loud, but the will to resolve the issue as soon as possible overcame the urge to chew out the clueless administrator. He downloaded the software, sat through the installation process, then typed in the TeamViewer ID.A connection could not be established."Of course," Michael muttered.A quick call to system administrators confirmed Michael's fears: the company firewall blocked all TeamViewer connections. Gaining access meant submitting an exemption request and letting the bureaucracy take its time to process it. The process usually required several days, and the rollout couldn't wait that long.Facing a dead end, he tried to explain the situation to the DBA.I can't get on TeamViewer. Can you please just tell me the username and password for the SQL Server? It would really save us a lot of time!!He sat back in his chair and waited, eyes glued to the IM window. His hopes weren't high, but maybe he'd at least get an excuse to present to his boss.Instead, the reply came:Username: dba, password: rosebud. Let me know if I can be of any further help.It was all Michael could do not to slam his head against his desk. After careful consideration, he decided to pass on the DBA's kind offer.[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: An Unusually Childish Debate
"Hilarity ensued when, during a recent political debate, the subtitles used by the Swedish state television came, not from authorized subtitlers of the debate, but rather the neighboring children's channel," Jonas writes.
CodeSOD: Log of String
The English language contains words with multiple and often contradictory meanings. A dress, for example, is only one of many items you could put on while dressing yourself. Meanwhile, if you want to wear pants instead, you should avoid pantsing yourself, as that would be counter-productive.These shades of meaning come into play frequently in programming. Writing a .NET application to manage school schedules requires some contortions to avoid using the reserved word class, and writing one to hold Dungeons and Dragons character sheets requires you to spell out the attribute Intelligence instead of using the far more common abbreviation int.Dimitris, however, wasn't thinking about the many interesting tidbits to be found in the English language as he went about tracing an error message through the stack his formula engine application had unraveled. Instead, he was thinking about logging. Not the act of felling trees and preparing their corpses for use by humans, but the act of writing messages to a central location so that debugging an application would be easier.Logging has a fascinating etymology, by the way. It originally had to do with a bit of wood that was designed to float upward when a ship sank, making it easier for someone to discover what had befallen the ship by reading its log. In the same manner, Dimitris wanted to discover what had happened to the application—but he got distracted along the way.
Announcements: The Abstractions Conference: Pittsburgh
Back when we were setting up The Daily WTF: Live, I gave a shout-out to the Pittsburgh tech community group, Code & Supply. They’ve been a great way to network with local developers, dev-opsers, designers, and more, ranging from the seasoned vets to those just cutting their teeth on IT. I’m a huge fan of their events, and I only wish I could make it to more of them.But there’s one event I’m not going to miss, and if you can get to Pittsburgh, you shouldn’t miss it either. Code & Supply is launching their new conference, Abstractions. Abstractions, like Code & Supply, is a cross-techology, multi-skillset event, dedicated to bringing some of the best speakers in a variety of technologies together for one of the best conference lineups I’ve seen.
Freelanced
Being a freelancer is hard. Being a freelancer during the downturn after the Dot-Com bust was even harder. Jorge was in that position, scrambling from small job to small job, fighting to make ends meet, when one of his freelance clients offered him a full-time gig.Carol, the customer, said “Jorge, we’re really short-handed and need help. We’d like you to start on Monday. You know PHP, right?”Jorge didn’t know PHP, but he knew plenty of other languages. He said yes, crash-coursed over the weekend, and was confident he could learn the rest on the job. When he showed up on Monday, Carol introduced him to Luke- “who will mentor you on our application.”“Hey!” Luke grabbed Jorge’s hand, started shaking, and kept at it for far longer than comfortable. “It’s great to have you here, really great, you’re really going to like our code, it’s really really great. We’ve got a lot of great customers, and they’re really really happy with our great software. Do you like encryption? I built our encryption layer. It’s really really great. And I hope you like getting things done, because we’ve got a really really great environment with no obstacles.”Jorge recovered his hand, wiped it on his pants, and tried to smile to cover the internal panic that was taking over his thought processes. That internal panic got louder and louder as Luke showed him the ropes.They had a few dozen tiny applications, and the code for those applications lived in one place: the production server. Server, singular. There was no dev environment, there was no source control server. Their issue tracking was, “When there’s an issue, a customer will call you, and you’ll fix it.” Luke explained, “I like to work on it while I’m on the phone with them, so I can just edit the code and have them refresh the page right there.”Jorge nearly quit, but Carol had been a great customer in the past, and he really wanted a steady gig. He ignored his gut, and instead tried to convince himself, “This is an opportunity. I can help them get really up to speed.”He found an ancient Cobalt RaQ in a closet, with a 366MHz processor (with MMX!) and 64MB of RAM. Jorge hammered on that whenever he had a spare moment, setting it up as a dev environment, a CVS server and Bugzilla. This took weeks, because Jorge didn’t have a lot of spare moments. Luke kept him busy on a “deep dive” into the code.Jorge was largely ignorant of PHP’s details and nuances, but Luke was massively ignorant. Luke’s indentation was so chaotic it could double as a cryptographically secure random number generator. Wherever possible, Luke reinvented wheels. Instead of using a server-side redirect, he instead injected a <script> block into the page to send the browser to a different page. When PHP changed their register_globals behavior for security reasons, Luke didn’t think about why that happened or what that meant. He didn’t even bother to flip the PHP.ini flag which would revert to the old behavior. Instead, he just pasted this block into every PHP file:
CodeSOD: High Performance Memory Allocation
Jamie has a co-worker who subscribes to the “malloc is slow” school of thought. Now, for most programs, it’s fine, but Jamie works on a high-performance computing system operating in a massively parallel configuration, so there are portions of their application where that philosophy is completely valid.In this case, however, the code Jamie’s co-worker wrote is in their message handling layer. There’s really no reason to pool buffers there, as the performance gain is practically non-existent based on the frequency of buffer allocation. That doesn’t change Jamie’s co-worker’s opinion though- malloc is slow.
Dude, Where's My Hard Drive?
What, again? Michael stared at the Explorer window in disbelief. The free disk space bar was glowing red, and the text underneath reported that his half-terabyte system partition had a measly few gigs left before filling up.When it had first happened, he hadn't thought twice about it. In fact, he'd been rather glad; at least he'd had the motivation to finally discard all the games and software he would never use again. But when the disk space ran out again the next month, and again the month after, he started getting more and more worried. Was he really using that much space, or was something else going on?Curious, he decided to finally investigate the issue. A cursory look at his hard drive with WinDirStat confirmed his suspicions. With over 80 percent of his hard drive space labelled as "unknown", something was definitely amiss. He kept searching, manually scouring through his folders and files, until finally he managed to pinpoint the culprit: an innocuously named "C:\Windows\System32\Config" folder filled with hundreds of thousands of files, taking up 420 gigabytes in size.A quick trip to Google and a bit of playing with Process Monitor revealed the answer to the mystery. As it turned out, every modification to Windows Registry—the oft-derided database of all the Windows and Windows application settings—generated a transaction log file to ensure the data integrity, prevent corruption, and allow rollback of changes. Usually those small 512KB files weren't much of an issue. They got deleted after a clean reboot, and most software only modified the registry during installation or after a configuration change.However, some applications and drivers—among them, Nvidia's 3D service—didn't play nice with the registry, shuffling the values around every few seconds or minutes. That, together with Michael's habit of not turning the computer off too often, resulted in cluttering the disk with more and more files until it filled up completely.The solution, luckily, was rather simple. Michael purged the folder of all but the most recent log files, then uninstalled all the unnecessary bloatware from Nvidia, hoping it was the last thing he'd be deleting for a long while.[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!
Error'd: Who Needs an Interface when you have Tape?
"We spent a good deal of time developing our customer information display software, to make it easy for our users to update the daily menu screen outside our restaurant," Steve M. wrote, "Someone, however, noticed that the price of the Fish Steak Crunch was wrong, and decided to take a more hardware-based approach to doing the update."
I Hate the Lord of the Rings
Today, we're breaking out something a little different. I put this together more for fun than anything else, and we piloted it around in the Side Bar, along with a few other shares.After some feedback, we're happy to bring this to the front page, and we plan to produce more of videos in this vein as a recurring periodic feature.Sometimes, it feels like getting our work done is an epic struggle, suitable for retelling by the greatest of bards. And you know what? You're absolutely right. IT is an epic quest- and that's why I can't stand the Lord of the Rings. It's too much like work.[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: Utter Filth
Terrell inherited some database stored procedures. Like all good, Enterprisey stored procedures, it was written in PL/SQL. Unlike most Enterprisey procedures, it had a clear purpose: to clean your dirty inputs.The actual problem: based on user input, the PL/SQL code needed to write a temporary file to the filesystem. Since user input is full of filthy, illicit characters, this procedure needs to clean them up.
The Productivity Leader
Jane took a job at a big financials company. The pay and the benefits were the first draw, but she was really sucked in by the visions of building analytics and juggling billions of dollars with cutting edge data mangling techniques. “Big data” came up in the interview many times, along with “cloud”.The first cold blast of reality was when she was given her developer desktop: a Windows XP box with 4GB of RAM and a CPU that could get lapped by the processor in a BlackBerry. “Oh, is this just a dumb terminal I use to connect to your cloud?” Jane asked.“No,” her boss said. “This is your work computer.” As it turned out, Jane had misunderstood the interview- they had asked about “big data” and “cloud” because those were buzzwords that they might be interested in, someday. Today, there were only two applications Jane needed to worry about.Corporate policy dictated that her computer must be shutdown every night. Each day, when Jane came into work, she would start it up. After a few cups of coffee, it would eventually chug to life, at which point she could fire up the two required applications: Outlook and SameTime.Jane wasn’t officially considered “at work” unless her boss saw her logged into SameTime. In fact, as Jane quickly discovered, the rapid path to promotion was to leave yourself logged into SameTime for twelve hours a day. Even if you never committed a single line of code, that was enough to make you a “productivity leader”, like Chad.Chad was the “productivity leader” on their team. He had committed just one, one-line-bug-fix in his entire time at the company, but he was always online. Once or twice a week, Jane’s boss would swing by, “Hey, you should really talk to Chad,” he’d say, “I’ve told him to mentor you, and he’s got exactly what it takes to succeed here.”Jane didn’t, because sometimes, Jane would try and write software. The emphasis was on try. The first step was to launch Eclipse. The only version she was allowed to use was so ancient that it predated the Jovian naming convention. Waiting for this to start was enough time for Jane to exhaust her phone’s data plan streaming Netflix.Finally, Jane could actually look at some Java code. Running it was a bit more of a challenge- it meant launching a local WebLogic server, connecting with Firefox, and then trying to replicate and fix bugs. Between the ancient hardware, the ancient OS, the ancient Eclipse, a version of WebLogic that was so old that it could be featured on Antiques Roadshow, and code that was intimately tied to the database server, it could take hours to make it through a single edit-compile-debug cycle.It was an uphill battle against processes and attitudes that were frozen in 1983, but each Day, Jane went home, confident that she had made the code better. In a small way. A very small way.One day, Jane’s boss transferred to a different team and vaulted up a pay-grade in the process. Their “productivity leader”, Chad, was sucked into the vacancy in his wake. On his first day, Chad called a meeting.“Now, I know we’re a little behind the times here,” Chad said.Jane nodded like a bobblehead.“And I know that we spend more time sitting and waiting than doing any real work,” he continued. “But I’ve been talking to management, and they’re really enthusiastic about modernization. So be ready for some big changes in the near future, and not to spoil anything- but the word ‘cloud’ is going to feature big in our plans.” After the announcement, Chad asked Jane to stay behind. Once they were alone, he said, “I’ve been meaning to talk to you about the amount of time you’re logged into SameTime…”That was the last Jane heard about the modernization project until Chad sent out a memo announcing the new “Dev Cloud Machine”. “Now,” his memo explained, “pretty much all cloud provider options require us to put our software into their infrastructure, which we don’t want to do. Instead, we’ve built our own ‘private cloud’.”This so-called “private cloud” was an old desktop machine that was pressed into service as a WebLogic server. Gone was the painful struggle that was their edit-compile-debug cycle, and in its place was a “cloud” process. Jane edited the code locally, didn’t run it locally, and instead checked it into CVS. An automated job (running once every fifteen minutes) pulled the code from CVS, built it, and deployed the resulting WARs onto the “Dev Cloud Machine”. Now Jane could connect to the WebLogic server and check her work.The Dev Cloud Server also used the QA database as its backend, an environment which QA, shockingly, used for their own tests. This frequently caused schema mismatches and added to the overall churn.Even if she wanted to, Jane wasn’t allowed to go back to the old process- since the developers no longer “needed” WebLogic, corporate policy was that it was now forbidden. This rule was enforced by a script that deleted WebLogic installs with every bootup. “For consistency,” Chad explained, “we want all of the developers to use the same process, and that process is the Dev Cloud Machine.”Some time after this policy change, Jane’s SameTime client stopped working. Maybe the WebLogic policy broke a DLL somewhere, maybe a file or the registry got corrupted somehow. Jane had no power to reinstall, so she raised a ticket. It vanished into wherever tickets go to get ignored by the Help Desk, and Jane did her best to focus on getting work done.Every few days, Jane would repeat the same conversation with Chad. He’d call her into his office, and say, “We have a problem with your SameTime logins…”“Yes,” Jane said. “I’ve raised a ticket. I can try and get it escalated.”After a few rounds of this, though, the conversation changed.“I have tried to stress the importance of our company policies,” Chad said, “specifically regarding SameTime. And I have to say, your lack of compliance on this front has become a serious problem. We’re going to have to ask you to clean out your desk…”Jane didn’t bother to mount a defense, and walked out happier than she’d been since she started.
CodeSOD: OutputCache All The Things
Steam. AT&T. Marks and Spencer. Bebo. What do they all have in common? One morning, as customer support tickets rolled in at her online retail firm, it became Belle's job to find out.Belle had inherited the codebase, which had originally been made overseas in India. It seemed as solid as any offshored website could be—which is to say, it had a million different quirks and the source code made her want to vomit, but it had been tested until the BA got tired of filing bugs and just decided to put it in prod.So Belle expected it to get basic functionality like ordering a product right. Alas, that assumption was unfounded. While the BA's testing had been, for all intents and purposes, single-threaded, no sooner had the doors been opened to the public than reports came in of users being greeted by the wrong name, and with the wrong list of stored credit cards. Once the Ops guys rolled it back, Belle girded her loins and dove into the code head-first.The first thing she found while tracing the retrieval of user credentials was this gem:
Error'd: There's Nothing to See Here
"Really. There's nothing to see here. Move along," wrote John A.
CodeSOD: The Helpful Customer
Sven built a PHP-based website on contract then handed it off to his customer, Bob.“You won’t be getting a lot of support calls from me,” Bob said, “because I actually know a thing or two about PHP. I’ll be maintaining this myself.”Sven smiled, nodded, and moved on to the next contract. Months later, Bob sent him an email. “Hey, sometimes, the submit button isn’t available, and I’d like the submit button to appear all the time, but I can’t figure it out.”Sven was busy, didn’t reply right away, and wasn’t terribly surprised when his customer pinged him back: “Nevermind, I got it.”Eventually, though, Bob did find a problem he wasn’t confident enough to solve himself. When Sven had handed it off, the logic to show the submit button looked like this:
Foxxy Professionalism
It was the mid-nineties and the Iron Curtain in urban Kerblekistan had come crashing down. Everything was in turmoil, and people were trying to make up for all of the years lost behind the locked borders by trying everything with enthusiasm. The WWW was still in its infancy, but that didn't stop the budding entrepreneurs.Enter a young whippersnapper, still in high school. Daddy hooked him up with a buddy of his at a certain state institution. Now don't go imagining secret agencies or ministries-of-defense; we're talking more like parks-and-recreation. Therein was a department that still had a nice chunk of unspent budget. In the sweet tradition of bureaucrats everywhere, they were looking to spend it and hopefully wind up with something to show for it.The kid went to meet the head of the department. He took the bus to a narrow street near the center of the city. The building guards checked him out and let him in. The interior was the expected pre-iron-curtain Kerbleki decor;the ancient elevator, the carpeted dark corridors, the musty offices and portraits of stoic leaders overseeing all.The department head was a nice enough older gentleman. He explained "Look kid, we have to manage a lot of people and resources. We keep it all in these notebooks and ledgers, with hand and pen." He opened up the big iron closet and the kid saw row upon row of paper files. He continued: "We got this spare PC around. Do you think you can do something to put it all in there?"The young boy was sure he could, so the head promised a nice chunk of change for the work.The kid hooked up the 286-PC running MS-DOS and decided to go with Fox Pro. He drew up some menus and UIs. He planned some database files. He spent his summer vacation entering all the data from the files into the computer. He ironed out the bugs and made it work.And work it did. It had search. It had all kinds of nifty tools for stuff they used to have to do by hand. It printed reports to the printer. It did backups on floppy disk. For its day, it was pretty slick.Everyone was ecstatic and the kid got his money. The department showed off the program to everybody.Sure, they still had to keep manually entering the data into paper files (that was the official way after all). But once they also entered it into the PC they could do all kinds of neat stuff with it, in mere seconds.Apparently, Kerblekistan hadn't yet learned how real IT projects turn out...A couple of years later, the kid was now a young man at college. One day Daddy called again, to arrange a meeting with the old department head. He said that there was some more money to be made. In dire need of cash, the kid took a break from girls, booze and pool halls and went back to work.The scenery had changed. The old institution was no longer drab and under the watchful eyes of Kerbleki leaders. It had been westernised and was much nicer.The department head was happy to see the kid. They still used his program every day. The old PC was, amazingly, still running perfectly, in its corner, if under several sedimentary layers of dust.The department head mentioned that they now all had these nicer, faster PC's. They needed to be able to use the program from each of their own PCs, and perhaps add some stuff, like getting reports out as PDF, and sending them over email. He then offered a bit of cash up front, and there would be some nice money in it for success.Now, you're probably smirking and settling down in your armchair to better enjoy this part. You're saying to yourself, I smell a classical Fox Pro "multi-client" monstrosity, built with single-lock files in Novell network shares.But you're not giving the young guy enough credit. Between all the girls and boozing the guy managed to do some reading. He looked over the PC's and the head guys' box was the best and by far the most powerful. He told the boss "We're going need one PC to be the 'master'; it will have to be on for the others to work." Since the boss was the first one into the office in the morning anyway, he agreed.So the young guy got to work. They had Windows 98 on the PC. He slapped installations of Apache and MySQL on there (because adding web servers and the internet always speeds things up). He started designing web pages and relational databases. He wrote some scripts to port data from the Fox Pro files over to MySQL. Sadly, he couldn't find the original sources for the program anywhere, but it would be OK; it's not like Fox Pro translates well to PHP anyway. Besides, the old guy probably knew the procedures by heart.So one day it was finally done, sort of. He felt that it wasn't exactly his best work ever. Any search at all took ages. Maybe he hadn't quite grasped those "index" things yet. He poked at it for a few more days but time was running short.He didn't know if the problem was his inability to make things efficient in MySQL, that the web-stuff was more expensive (chronologically) than he thought, both, or something else. After all, PHP had been around for a few years, so it must be stable and fast, right? Maybe MySQL was too new and there were unknown issues? What performance problem could possibly be caused by web servers?Finally, he got into a bit of a panic. This stuff was cutting into his chicks and booze time and it wasn't getting any better. He went in one morning, slapped it on the boss's PC, showed him around and then excused himself for a rapid exit. He disappeared, didn't return the advance money and left daddy to deal with his old buddy.So they wound up still using the original system on the 286 until the old guy retired a couple of years later. And you'll be happy to know that they managed to spend the budget that year anyway.By a show of hands, who thinks the kid would go on to have a bright future in software management?[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: Reloaded Commands
William Heimbinger joins the ranks of developers who come to us to confess their sins. This particular sin was committed when he was but a young child of fifteen years old, which raises more questions than it answers.Young William was writing Perl and building an anti-spam bot for IRC channels. As he wrote code, he wanted to quickly reload the module to test it, but actually learning how to reload modules looked like too much work. William decided to reinvent that wheel, using a hammer he already knew.With a trivial block of Perl code:
The Backup Pipeline
Dick was the main man in charge of his homegrown facilities-management system known as Q-Max. His brainchild was utilized across a large office complex to enter and track building maintenance tasks. Whenever a sink was broken, toilet clogged, or a foul-smelling science experiment had to be exterminated from a fridge, Q-Max was there to track and route the incident.While that was its original intent, Dick wound up selling the office managers on expanding its role to include reporting that would help them make budgetary decisions. It helped them determine which maintenance guys deserved a raise and which buildings needed renovations the most. So despite the maintenance department despising Q-Max because it made them do stuff, management loved every bit of it. Little did they know how precarious the system was on the backend.Dick focused on keeping this amazing application running, and let the company's "Disaster Recovery Team"- one guy named Pete- worry about the worst case scenarios. They kept a regular offsite backup of its data so that in case of something catastrophic like a meteor strike, Q-Max would not go the way of the dinosaurs. Their backup system was quite simple, yet had a necessary workaround step - Every night around midnight an Oracle backup was created on the database server. From there, they copied to an offsite tape backup. Due to infrastructure limitations- bandwidth and reliability, mostly- this mirroring process had to run to get the backup to a location the tape robot could get its iron clutches on.Eventually Dick and Q-Max grew even bigger and got a larger budget to spend on infrastructure. Some network upgrades allowed Pete to have a backup system which could copy a backup directly to the tape library, thus eliminating the need for that silly mirroring job. The new system was implemented and taking nightly backups was a breeze.A few years passed as Q-Max continued to have its automated backups taken every single night. One cold winter's eve, an old pipe that happened to run over the office's server room froze and burst. One of the many casualties of the unplanned cold shower was the database server that housed Q-Max. Pete called Dick frantically one night while he was home sipping hot cocoa."DICK, I NEED YOUR HELP! There's water everywhere!" Pete shouted to him. "It's raining in the server room!"Thinking Pete was delusional, Dick calmed him down to get the full story. The loss of the database server and several others was troubling, but at least they still had their trusty offsite backup tapes! "Man, that sucks. I'll come in to help clean up and salvage what we can. In the meantime, put in an urgent request to have the last backup tape delivered first thing in the morning!"Since Q-Max was down and there were no maintenance people to be found, Dick and Pete spent the night with mops and buckets cleaning up the pipe's mess. Around 7 AM, Dick was paged down to the lobby for a delivery. "The tape is here!" he exclaimed with joy, eager to get Q-Max back online.Dick brought the tape back to the now-dry server room and prepared to restore from it on an alternate database server. The tape directory stared back at him blank. "That's odd, there's nothing in here. They must have sent the wrong tape!" Dick put in an angry call to the company that housed their tapes. They checked other tapes that had been used for Q-Max backups only to find all of them were blank.Furious, Dick could think about nothing but lawsuits against the company that screwed up their entire backup system. In the meantime, he dispatched Pete to prove the backup job on their side was working. Pete ducked out for an hour or so. When he returned, he looked like he'd just been diagnosed with some horrible disease."I checked out the backup job and, well, you're not going to like this..." Pete muttered nervously."Ok... what exactly happened?" Dick asked, unsure if he actually wanted the answer."Well, the good news is our backup job is working fine. However... Do you remember long ago when we had that stupid mirror job to copy the local backup to the external tape drive? I kinda, sorta, forgot to disable that. So after our new backup job runs, the old one copies an empty directory over top of it, and the legitimate backup is lost. It's been like that. For years."If there was any remaining water from the pipe bursting, it would have turned to steam as Dick became red hot with anger towards Pete. Dick would have to strangle him later, though. First he had to figure out how to rebuild Q-Max's data from the ground up.[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: Blame the Computer
Jason M. wrote, "A city park has a computer problem so unsolvable, that they made a sign about it."
CodeSOD: The Flasher
Michael H sends us some code that probably deserves a NSFW warning for exhibitionism. This code is a confusing bit of metaprogramming that… well, shouldn’t be allowed near schools or playgrounds.
The Carte Blanche Pattern
"Rejoice! Rejoice! Emmanuel shall come to thee, O' Israel!"Something was definitely up. Ricardo, the team lead, hadn't stopped singing carols that day. Sure, it was a few weeks before Christmas, but that was hardly an excuse to serenade the whole office. No, something had happened, and Erika was determined to keep out of it.This wasn't the first time Ricardo had gotten prematurely excited over something. Usually dour and unhappy, when he truly believed in a project, he'd hype himself up about it until there was no talking sense into him. It was best to lie low. If you got sucked in, you'd only be blamed when the inevitable fallout crushed his spirit yet again.Unfortunately, fate seemed to have it in for Erika. Ricardo made a beeline for her cube, still singing carols."I bring ye tidings of great joy!" he announced, knocking on the sidewall of her cube. "They agreed to rewrite the frontend—this time, with a CMS!"That was good news. Nobody liked the aging frontend, but nobody ever seriously broached the subject of redoing it, not with the usual budget austerity. It worked, and it was "only" six years old, they should be able to patch anything that had security implications and keep it running for another ten years. Just like a used car, right?The biggest complaint was that it had no Content Management System. Every tiny image tweak Marketing wanted, every news article, every dynamic piece of content was achieved via a promotion. They'd separated content from structure as best they could in small payments on the tech debt over the years, but the prospect of a proper CMS, where they could hand the keys to Marketing and wash their hands of the content, was like Christmas come early. Still, Erika couldn't help but wonder where the catch was."What's the deadline?" she asked, already preparing to cringe."That's the best part: you won't have to worry about the project or the tech design or anything," Ricardo answered. "They're sending over a couple of guys from the East Branch to run the whole thing. Apparently they've had a CMS for a year now and love it, so they want to build the exact same thing here."Erika bristled. If they had a CMS in the East Branch, why did they give her so much crap about putting one in Corporate HQ? And now a couple of clowns were coming in to tell the team how to do their jobs?Sensing her frustration, Ricardo beamed at her. "Hey, don't worry. I know these guys. They're a couple of certified geniuses. I hear they used to work at Google! They know what they're doing, they just need us to supply a few extra pairs of hands and they'll run the whole show. I got Marketing to agree to give them free run of it, carte blanche, whatever they say goes. This is going to be the best project we've ever done!"A year later, it was almost Christmas yet again—but this time, there were no festivities in the air. Erika's hair had grown out and reverted to its natural colour; she couldn't be bothered to head to the salon, not when every day she felt like drinking herself into a stupor. Marketing seemed bound and determined to take all of IT down and replace them with offshore developers, and with good reason: every test they ran on the shiny new frontend found some new "Critical" bug. Validation was never quite right. The workflow was nothing like the design had promised. The styles were off. The images were wrong. The CMS was serving up content scheduled for the future, but only on Tuesdays. Every bug that got fixed introduced another four.Ricardo spent most of his time in meetings, trying to quell the Marketing demons and lull them back into their unhappy slumber. Erika's task was testing the application as rapidly as she could, despite no real QA training. If Marketing's testers received another bad build, all hell would break loose. The last glimmer of hope within her suggested that if she could just get a look at the code, maybe she could figure out what was wrong. Maybe she could solve it. There had to be a Node module that could fix the systemic problems, right?"Which branch is the code on?" asked Erika, passing Ricardo in the hallway. "I thought I'd take a look—""Don't you dare." Ricardo actually stopped to grip her shoulders tightly, a terrified look in his eyes. "I thought that last month, and I've regretted it ever since. I've seen things I can never unsee in that codebase. Single letter variable names. Views mixed with models mixed with half-hearted validation. Tabs and spaces together, Erika! As if they belonged that way! Don't you dare throw away your sanity on this project, you hear me?"Ricardo's theatrics aside, Erika was now more convinced than ever that she had to see the code for herself. Not because she could fix it, but because she was morbidly curious. When Ricardo wasn't looking, she poked around the repo, checked out a working copy, and sneaked home with her laptop and a bottle of chardonnay to see what she could find.The first file she opened was the account creation workflow. Remembering Ricardo's words about spacing, she ran it through Sublime's re-indention methods before she read any of it. Soon after, she swapped the chardonnay for whiskey, but she began to comprehend the problem: these guys were not developers. They didn't understand how to construct software. Whatever they'd done at the East Branch was, had to be, a fluke. Their best code was all ripped straight from StackOverflow. They were desperately trying to make intelligent decisions, but they kept coming up with bizarre conventions like this one:
CodeSOD: Ch-ch-ch-changes
Archie poked around in his company’s billing system. This was a mistake, because that system is implemented largely in PL/SQL, and only a developer made from the sternest stuff can deal with PL/SQL.Like most PL/SQL applications, the Oracle database is the closest thing they have to version control. Each developer makes changes in the live dev environment and then hopes for the best. They don’t use TOAD or SQLPlus or any “normal” tool for making these changes- they have to use an in-house developed GUI, because that GUI tracks their changes and writes rows into a database called “VersionDB”. When they finish a patch and want to release the changes to their customer sites, they send a copy of the VersionDB and let a simple script apply all of those changes.
Management Reality
Merriam-Webster says that synonyms of stupidity include boneheadedness, brainlessness, denseness, dim-wittednes, dumbness, mindlessness, senselessness, thickness, vacuity and witlessness (among others). Perhaps they should add management to the list.For some reason, managers tend to make leaps-of-faith in the realm of technology. If they think that they know the meanings of two words, then there must be a connection between those two words. Unfortunately, whether the connection is real or imagined, they seem to proceed as though it were always real.A couple of years ago, Harold worked for a modest company. It was your garden variety organization with the usual amenities (a break room, candy and soda machines, etc.). In this place, strict adherence to the Dilbert Principle was the standard for hiring and promotion, and the CIO was a prime example of this rule in action. The powers-that-be believed this individual to have an in-depth understanding of how technology worked, and how different roles (e.g.: developer, QA, etc.) interacted, and so he was promoted to Chief Insipient Oaf.The CIO had a very high opinion of himself and of his supreme knowledge and mastery of all things. After reading an article on the subject on the InterWebs, the CIO decreed that a new high-tech think-tank would be created to foster design, productivity and camaraderie within the organization.This facility would have a certain Feng Shui to drive the layout and ambience. It would have a specific quantity of each of a certain type of computer. There would be erasable surfaces upon which new brillance could be scribbled. It would showcase successful projects, as well as industry awards. It would even have a high-tech table capable of dynamically expanding to match the number of folks in the room (e.g.: a dining table with additional leaves).Teams would be able to brainstorm new solutions in record time in this conducive environment. Inter-team sessions would enable people to optimize work flow and productivity across departments. This new think-tank would elevate their performance to levels worthy of the word enterprise.He even wrote about it in non-peer-reviewed magazines, without discussing it with anyone above - or below him in the organization.One day, the CIO's minions were sitting around their department break room, reading and discussing their leaders' bragging about their new think-tank. In particular, since they'd never been told of its existence, they were trying to figure out where it was located. After all, they had no room that featured such computers, awards or successful projects, and it might be nice to leverage such a room for its intended purpose.Fortunately, the CIO had mentioned enough facts in the article about the think-tank that the staff was finally able to deduce that he was actually talking about their break room.One can only wonder what might have happened if someone had actually requested a brainstorming session in the think-tank...[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: Let's Party like it's 2005
"I can't tell if it's a proofreading or a 'Y2k15' glitch," Ken L. writes.
CodeSOD: Good Idea, Bad Idea
After years of neglecting their command line tools, Microsoft decided to try and build a grown-up set of administrative tools, and released PowerShell. Nearly a decade later, and many of their flagship services still don’t integrate neatly with PowerShell. The syntax is a bit messy, and the promises of an object-oriented shell never quite came to fruition. PowerShell is a great idea, executed poorly. For all that, it still offers certain advantages compared to the Unix family of shells, and is certainly worlds better than ol’ CMD.EXE.Speaking of good ideas executed poorly: backups aren’t a good idea, they’re a great idea. And when Tommy took over as an Active Directory engineer, he was happy to hear that his predecessor had left behind a script that backed up all their user data on a daily basis. Tommy was significantly less happy when he saw the script.
Let Them Eat Cookies
As a Python developer, SEO was far outside of Ian’s toolbox, more in the realm of expensive social media consultants. However, when his friend Alec asked for help, he knew he couldn’t turn him down.Alec worked at LightBarn, a lighting supply company, and was overseeing their SEO optimizations. Alec explained that no one could actually find the company’s website with relevant keywords on popular search engines. “I looked all the way to page 150!” Alec said. “I don’t get it. We have plenty of inbound links.” Alec had worked for months writing a blog on the company’s site, and his posts were routinely linked to by other industry sites.
CodeSOD: A SASsy Import
After ten minutes of Mike staring at the screen unmoving, Jill sighed. As the newly minted tech lead, she knew that she had to help unwedge problems. But she also knew that Mike had been tasked with a task which should have been simple, had the project been developed in their team. Alas, it had been thrown over the wall for them to maintain, as a “reward” for cleaning up so much else.The calculations for generating quotes for customers were, for some complex scenarios, quoting too low; they were missing some items. The originators of the quote system had used Excel, so there was probably a hard-coded range to be updated. She’d asked Mike to fix it, create a playbook for this system and create a ticket sketching out what might be needed to make the system more resilient and maintainable. Excel would still be required, for the actuaries wouldn’t hand over formulae in anything else, but perhaps some jiggling into independent sheets and just running summaries over “the whole sheet” would reduce the pain. Jill had thoroughly cautioned Mike that he did not want, at this point, to discover the paperwork and bureaucracy to change how the calculations were performed, so the only changes to be made in this first approach were to be the minimum necessary, while keeping the style and solution intact.What Jill did not expect as the first question from Mike, when she went over, was an inquiry into just what the bureaucracy would be like, to bite the bullet immediately. Humoring him with an explanation, she was somewhat more taken aback when, after only brief cussing, he started pulling up the forms to do so.Once she saw the code being maintained, and Mike’s proposed replacement, she signed off immediately on the paperwork parts she was authorized to approve, and went off with a printed copy to get the co-signatures needed. By the time they were done, the time taken for this override process set a new institutional record for “fastest approval”. Sometimes, lumbering bureaucracies could move quickly; dodging a bullet during a budgetary crunch with no funding available for empire expansion will do that.The code, and Mike’s replacements, went into training materials for the team. The original code may be found below; it can be summarized as:
Announcements: TDWTF API
Happy New Year! Have we got some great news for you. Subramanian has contributed a RESTful API for accessing our articles, which we’ve deployed. So now you can get started on your New Year’s resolution of writing and sharing more code.You can check the docs here. I know Subramanian is working on using this to build an Android app, which we’ll be happy to announce here when he’s ready. If you use this API for anything, do let us know. And if you have any thoughts for how to improve it, send us a pull request on GitHub. We look forward to seeing the cool stuff you guys get up to with this.[Advertisement] Scout is the best way to monitor your critical server infrastructure. With over 90 open source plugins, robust alerting, beautiful dashboards and a 5 minute install - Scout saves youvaluable engineering time. Try the server monitoring you'll 👍 today.Your first 30 days are free on us. Learn more at Scout.
Don't Click That
The year was 2004, and Scott S. has just begun his internship at IniBank: an underdog financial institution that would, over the years, grow up to be one of the biggest players on the market. Despite being fresh out of college with little experience under his belt, he quickly found his way around the corporate culture and acclimated to the Application Development Department.His first task was to assist in rewriting a simple, internal Classic ASP application into ASP.NET and WebForms. Eager to work with the then-new and shiny technology, he spent his days researching the documentation, asking questions, and learning the ropes, slowly producing useful code.One day, as he was tweaking a simple grid, Tim—the project manager and his internship overseer—stepped into his cubicle. "Hi, how's it going?" he asked jovially. "Enjoying the company so far?""Sure!" Scott smiled. "The people are nice, the project is pretty cool, and all in all I'm having a good time here.""Well, I'm glad to hear that, because I've discussed it with the management, and we're thinking of offering you a permanent position.""Really?" Scott's eyes shone with glee. Straight out of college, and already getting a real job, how cool is that? he thought."And how's the rewrite?" Tim asked, taking a seat next to Scott. "Can I see your work?""Okay. Today I've been working on the customers view." Scott brought up the project, ran the application, and brought up a simple table. "It's almost done. You can add a person, you can edit their data, but you can't—""Hmm, let me see." Tim took the mouse and keyboard from Scott and started testing the application. After adding a few customers and playing with all the sorts and filters on the table, he spotted one more button. "Okay, so now, I click here, and it should delete the customer, right?""Um, don't—"Scott tried to say something, but the cursor was already hovering over the red "Delete" button.Click.Now, these days, IniBank has all sorts of test environments and safeguards in place. Back in 2004, however ... to say it wasn't the case was an understatement. In fact, Scott's application was hooked directly to the production environment, running happily with database administrator permissions and ready to wreak havoc.So when he heard the mouse clicking, his stomach instantly grew as heavy as an iron ball. Because he knew which part of the code he couldn't get to compile, and which part he'd commented out just a few minutes ago ..."Uh, Scott?" Tim frowned. "Why is the grid empty?""I, I ... The WHERE clause ... I'm so sorry," Scott mumbled, his face pale as a sheet of paper, as he frantically tried to remove the filters and change the parameters. But the DELETE statement in his code did its work masterfully—and since it was only half-written, instead of removing the single customer marked for deletion, it simply wiped the whole table."You didn't ... oh God!" Tim put two and two together. "Quick, let's call some DBAs and hope there's a current backup!"Luckily, after a few moments of downtime and a bit of angry shouting, the database was restored. Tim and Scott decided to share the blame and simply forget about this little incident. In the end, Scott got his position at IniBank—and a few years later, after Tim and a few other people left for greener pastures, he became the manager of the now-booming Application Development Department. And while Scott personally made sure a situation like this could never happen again by implementing best practices and proper testing regimes, he still enjoys spooking new developers with an occasional click on the "Delete" button.[Advertisement] Scout is the best way to monitor your critical server infrastructure. With over 90 open source plugins, robust alerting, beautiful dashboards and a 5 minute install - Scout saves youvaluable engineering time. Try the server monitoring you'll 👍 today.Your first 30 days are free on us. Learn more at Scout.
Best of…: Best of 2015: Byte Me
Happy New Year! Today's "best of" is the "best" code to copy file data that I've ever seen. Originally from September. --RemyThe great thing about Android is the low barrier to entry: thanks to open-source tooling, emulators, and the decision to build on a language often taught in schools, just about anyone can write a simple little app.The worst thing about Android is the low barrier to entry. Just about anyone can write a simple little app, whether they know what they're doing or not. The following code snippet is intended to take bytes from an InputStream (a common paradigm for web in Java) and save them into a file.
Best of…: Best of 2015: The A(nti)-Team
Building a good, healthy team environment is hard. In this story, they just don't bother. --RemyIn the 1980’s, there was a TV show called The A-Team. There was the scrounger, who could scam anyone out of anything. He would make promises that were sort of true to get what he wanted (sound like marketing?) There was the tough guy who could intimidate anyone into doing anything. He knew how to get things done, but underneath it all, was a nice guy. There was the leader, who could always come up with a plan to save the day. And there was the one guy who was a little crazy (the good kind of crazy), but who you could count on in a pinch. There was also the occasional outside helper who would run interference and recon. This was a group of folks who worked as a well-oiled machine to get the job done. Failure was not an option! They were a team!The A-Team never filed a project methodology document. No wonder they were wanted criminals.Alex had taken a job on a new greenfield development effort to replace an aging and unsupportable birds-nest-o-wtf™. Naturally, the position was advertised as “we intend to do things right!” The project is fully funded. We will have the proper equipment and team personnel to get this job done. We have the full support of six layers of management plus all of the users. Alex was optimistic.The first thing they did was spend several months wrapped in those numerous layers of management, end users, support folks, senior people who used to support the project (to explain the problems that plagued the old system), and the three architects of the new system. The new architecture was heavily documented, presented to and signed off on by all of the above. It was even reviewed with a critical eye by an independent third party regulatory auditing agency to ensure that the overseeing authorities were confident that the correct approach was being taken.An 8 page document detailing development coding guidelines (e.g.: code formatting settings, naming conventions, unit tests, code coverage and other such team-wide items) was created, reviewed and decreed to be followed by all who worked on the project.The project was off to a good start.Job one was to hire the development part of the team. For this, they looked (very far) offshore to find the cheapest possible talent. After all, anyone can be trained, right? A team of 11 developers who collectively had 13 years of experience, and a team leader with 5 years of experience were hired and put in place.The next major decision was which database should be used. There were three in widespread use at the company. Since all of the databases were hosted on centralized servers, one was immediately ruled out because the hardware that hosted the data servers was insufficiently powerful to handle the expected load in a reasonable time frame. Of the other two, one was widely used by everyone on the team. They knew its syntax, quirks and limits. The the third was mis-configured to have a reputation as being flaky. However, that one also was the corporate standard. In spite of the objections of the team, they used the third one.Project management decided that QA folks could be brought in later.Finally, it was time to begin doing detailed design. The offshore lead decided that a lot of time could be saved by doing design on-the-fly as required. Of course, the architects objected, but the project manager agreed to it.And so the architects started working on building the controller engine and other such mainstays of the project. The junior team, which was to query numerous remote systems for input data, merge, filter and pre-process it, decided that they knew better than what was specified in the architecture document, and started designing their own way of doing things. Without telling the architects or management.Come time for the first sprint check-in and all sorts of red flags flew up during code reviews. The junior lead decreed that the architecture document was only a suggestion that could be ignored in favor of the developers desires. Naturally, this spawned lots of are-you-f’g-kidding-me’s and emails up the chain. The project manager and above seemed disinterested, saying that the junior developers shouldn’t be doing that, but we trust them to do the right thing.This went on, with the architects pointing out implementation flaws and shortcomings that would not support the requirements. All suggestions were ignored, because the offshore lead said “Google fosters an environment of innovation and creativity; we should too!” He was reminded that Google is (in large part) a think-tank, and that this was a highly regulated project within a highly regulated industry. The architecture, which had been signed off by more than 40 managers, was not optional or a suggestion, but mandatory. This was not kindergarten, where creativity is fostered; you had to stick to the approved plan! Now, we’re not talking about how to write a subroutine, or encapsulate an object; we’re talking about using threading incorrectly and in the wrong places, doing database accesses and interprocess communication in such ways that would not be scalable, or provide enough throughput to finish daily runs by regulatory deadlines. Spawning multiple processes instead of just using threads. Using files to act as semaphores, because that’s how they did it in school. The list goes on.None of that mattered. The junior developers resented that they were not consulted on the architecture, and so were bent on ignoring it - with the blessing of their lead. The project manager continued to acknowledge the problems, but didn’t do anything about them. The problems were reported up the chain, and nothing was done. Everyone on the team should have an equal say in things.In the real world, if a student thinks the teacher is wrong, he doesn’t get to change his grade. The surgical resident cuts where the surgeon says and not the other way around. The general doesn’t discuss strategy with the privates. If you join a union, and as the new guy demand to have equal say on policy with the union bosses, you’ll be bunking with Jimmy Hoffa. Experience speaks with exclamation points. Inexperience speaks with question marks.Except on this “team”.The junior developers continued to do what they thought was best, ignoring the architects at every turn. Much of their code was written and rewritten several times over because the designs by the juniors didn’t take things into account. Things more experienced folks know to plan for. By the time 8 months had passed, so much damage had been done that some of the more complex requirements simply couldn’t be hooked in, and more than a month of back-pedaling had to be done on a greenfield development project.About this time, management acquiesced and asked some of the business users to write business-level tests (e.g.: via a spreadsheet that would be fed into JBehave to JUnit test things). The developers would provide the underlying code and some sample entries in the spreadsheets. The architects said that QA folks should be hired because business folks rarely know how to deal with edge cases, precision issues, etc. But the money was not to be spent. After six months of effort, the business users proudly decreed that all the tests for the entire application (e.g.: the entire requirements document) had been set up. A five minute glance showed that they didn’t handle edge cases, null cases, precision cases, or most of the other things that usually require tests. In fact, they had put all of the records that could possibly be processed (at least in their minds) into one giant pass-fail test. Of course, when something changed and it inevitably failed, there was no way to know what failed.Finally, it got so bad that the architects built a physical wall in the code between the setup code (written by the offshore folks) and main engine (written by the architects) sections of the application. Immediately before the main engine began to grind the data, every single variable in the system would be flushed to a state table in the database, so that when something would inevitably be challenged, they could show the inputs that were provided and send the fix-it work to the offshore team. At least this way, they could insulate the main engine from the debris.The department saved a lot of money by using cheap labor, no QA folks and the politically expedient database. Of course, all of the code of the setup portion done by the offshore team was a disaster, and for the most part, very difficult to learn, support, debug and enhance.The product hadn’t even been deployed yet, and the users were already complaining that it took too long to diagnose and fix problems (one of the main reasons the whole rewrite project was authorized), that perhaps the rewrite wasn’t satisfying the main purpose of the rewrite, and that perhaps something might be wrong…[Advertisement] Scout is the best way to monitor your critical server infrastructure. With over 90 open source plugins, robust alerting, beautiful dashboards and a 5 minute install - Scout saves youvaluable engineering time. Try the server monitoring you'll 👍 today.Your first 30 days are free on us. Learn more at Scout.
Best of…: Best of 2015: Tis' the Season
We just finished the holiday season, but it's not too long ago that we were wrapped up in a different kind of season: Hunting Season As commenter RFoxmich pointed out: this might be the first 0pt. "Buck". --RemyDeep in the wooded vales of red state America, December is hallowed not just for hunting presents, but also hunting deer. Lo, the season opened on a Friday. Clayton’s consulting firm declared it Camo Day in celebration.Employees festooned themselves and their office in their brown-and-green finest. Some posted deer horns and small taxidermic animals in prominent locations. While this particular company stopped short of installing a shotgun in the kitchen, just in case a bear happened along, it was still the most redneck of wonderlands.Clayton could even swear he smelled hunting musk as he moved through the floor, trying to get back to his desk after an exhausting code review. And everywhere he looked, camouflage-print duct tape lingered like traces of scat: patching a hole in the carpet, propping up the back of a swivel chair, cradling a leaky ceiling tile …Both tape and musk led to his manager Buck’s office.“How you doin’, Clayton!” His voice boomed out from the office like a blunderbuss’ payload, halting Clayton in his tracks. “How’d that code review go?”Clayton peeked in to find Buck applying a piece of camo duct tape to a patch of ruined drywall behind his desk chair. He ignored the scene to reply, “Fine. John has some changes to make, but nothing major.”“Good, good.” Buck rubbed a fist over the newly applied tape. “Don’t mind me, I’m just taking the initiative to fix a few things around here.”Clayton debated whether to say anything. In the end, he couldn’t help himself. “Uh, all that stuff you’re fixing probably needs more than duct tape.”This prompted Buck’s ringing laugh. “If you can’t fix it with duct tape, you’re not using enough!” Finished with the wall, Buck turned, yanked his laptop out of its docking station, and began wrapping the camo-colored tape around it.Clayton really knew better, but again couldn’t help himself. “What are you doing?”“Decorating my laptop!” Buck replied.“But … you’re covering the vents,” Clayton managed around his shock. “It’s gonna overheat.”“It’s winter and it’s cold out! This thing’ll be fine.”“Win—you’re taking it outside?” Clayton faltered.“Out to my hunting blind! I’m cutting out early to get a jump on the season.” Buck reached into his pocket. Out came an obnoxiously sized lock-back knife that he used to slice a gap into the tape layer, allowing him to open up the laptop.“Why bother working remotely?” Clayton asked. “Just call it a week.”“The usual BS quarterly meeting is this afternoon—of course.” Buck rolled his eyes. “Gotta join the WebEx and at least pretend to pay attention.”The WebEx would handle both video and audio for the meeting. Clayton imagined the deer would take a dim view to budget projections, but Buck’s laptop did have a mute button.“Happy hunting, champ! I’ll have my cell phone in case you need anything.” Buck packed his laptop, then gathered his coat and a cooler that was almost certainly full of beer.“Uh, OK.”In the end, Clayton couldn’t complain about a manager-free afternoon. He returned to his desk, dug into his work, and all was well.A few hours later, his desk phone rang. Buck’s cell.Clayton internalized a curse and picked up the phone. “Hello?”There was nothing on the other end at first aside from scuffling, and a string of very not-internalized curses from Buck.“Boss?” Clayton prompted.“The damn thing’s a brick!” Buck cried.“What is?” Clayton asked.“It just shut down on me!”“Your laptop?”“And the damn meeting’s still on!” More scuffling noises from Buck’s end. “Hopefully everyone’s too busy snoozing to notice I fell off the WebEx. Hang on, I’ll be in the office soon!”Clayton didn’t bother stifling his groan, but managed to hang up before it escaped.Twenty minutes later, Buck stampeded into his cube, cooler and laptop in tow. He dropped the camouflaged computer onto Clayton’s desk, shaking out his hand. “Sumbitch shut down on me out of nowhere!”Clayton felt the waves of hot fury radiating off the laptop when he stuck his hand near it. “It overheated, like I said. You blocked the fans that keep air circulating through there,” he explained. “We gotta get this tape off.”“Nah! If it’s hot, we just gotta cool it down, right?” Buck opened up his cooler and pulled out a half-melted bag of ice. He then turned and dropped said bag directly onto the laptop.Clayton’s jaw fell. Should he bother to say anything? No, it never helped.“While it’s cooling off, I’ll need your computer to log back into the WebEx,” Buck said.Clayton suppressed his instinctive panic. “You have to leave it here. No ice or camo. I’m done for the day, and I’m not touching any more work until Monday! Deal?”“Deal.”With a collecting breath, Clayton logged out, then stood to gather his belongings. “There you go.”Buck clapped him on the shoulder. “Happy hunting, champ!”[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!
Best of…: Best of 2015: Once You Eliminate the Impossible…
This article, from April had a problem, so they decided to use XML. Now they have An error occurred while parsing EntityName. Line 7, position 32. -- RemyOnce 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.
Best of…: Best of 2015: To Spite Your Face…
This article, from February had me cringing even as I reread it- and I wrote it! I've had the misfortune of working on a number of projects that failed because of people like Brandon making sure they failed. --Remy“I’ve got a gig for you,” said the recruiter.Clive, like many freelancers, weighed the contents of his bank account versus the daily rate he was promised, and decided that any gig was for him under those conditions. This one sounded mostly okay; an insurance company needed a new software package that would help them leap through some regulatory hoops. As a bonus, they wanted someone who could teach their devs the latest tools and techniques… like source control. Clive aced the interview, and started a week later. There was already an email waiting in his work inbox, from someone named Brandon. It read: “See me.”That nose won't know what hit it…Brandon lurked in his office, adhered to his mid–90s ergonomic chair like it was an appendage. He glared over his monitor and stared at Clive. “You work for me,” he said.In monosyllables and four word sentences, Brandon revealed that no one who participated in the hiring decision would have any day-to-day contact with Clive. Clive reported to him, and him alone.“Okay… well, when I was hired, they said that they wanted me to set up Subversion. Should I get started on that?” Clive asked.“No.”“May I ask why? Do you have another preference? Would you like to discuss the options?”“No.”Clive waited. Brandon didn’t expand. He simply stared at Clive. Stared, and stared.Clive slunk back to his cube and got started on looking at the code base. It currently lived in a file share, using the “file.pl.old”, “file.pl.old.old” versioning convention. The code was Perl, and unreadable by even Perl standards. It had grown in a culture here “parsable means runnable”, included no comments, and had absolutely no tests. Clive’s only ally was Lee, another head-hunted expert who also reported directly to Brandon, and had a two week head start on understanding the code. When Clive got stuck, he poked his head around the cube wall and asked Lee.Like a glacier grinding down a mountain, Clive slowly worked his way through the code. After about a week, he was developing a small degree of confidence. Then an email from Brandon arrived: “See me.”“You’re disrupting the dev team,” he said.“What?”“You and Lee are making too much noise. This is an office, not a social club.”“That’s crazy. I’m just asking him questions about the work we’re doing! What, do you want us to schedule a conference room just to ask questions?”“Yes.”Brandon stopped talking and resumed his staring contest. He stared, and stared… Clive got the point and scurried back to his cube.The requirements were complex and evolving, which wasn’t unusual. Only one user, Carole, actually knew what they were, which also wasn’t unusual. Clive sent her an email with a handful of questions, and tried to get some work done. He waited for a few days for her reply, and as he found new questions, he sent more emails.In a week, he had sent nearly half a dozen, but got no reply. He sent more, asking for status updates. Over this time, he had more questions. He tried calling her, but it dumped to a full voicemail box. He tried scheduling a meeting, but Carole never accepted.And then an email from Brandon arrived: “See me.”“Carole says you’re harassing her,” Brandon said.“What?”“You send her emails, even after she answers your questions. She said you called a meeting but didn’t show up for it. This needs to stop.”“That’s crazy. She never replied, and I can show you my inbox to prove it.”“Carole doesn’t use email,” Brandon explained. “An intern prints out her emails, and she replies via inter-office mail. She’s very busy. You have the requirements document. Implement it, and stop bothering her.”“What, you want us to implement a solution without ever talking to the business user who knows the requirements?”Brandon stared at him. And stared. And…With Lee’s help, Clive made some real progress over the next few months. They learned their way around the absurd date format (measured as the number of days since April 3rd, 1974, except when it was measured in the number of months since the preceding Monday, except when it was measured in the number of weeks since the following Sunday). They worked past the fact that no one was allowed to upgrade past Firefox 3, or the fact that they couldn’t run overnight jobs because all of the servers were turned off at 6PM sharp. Carole didn’t communicate, Brandon just stared at them, and the rest of their co-workers treated them like plague carriers.A few weeks before their six month stint expired, Clive was digging through the company network drive, searching for a spreadsheet containing sample data. He found one named after the recruiting company that placed him, and hoped that it was something useful. It was, after a fashion.The spreadsheet was a report illustrating exactly how much the recruiting company was getting paid to provide Clive and Lee. The fees were so abusive a used car salesman would have blushed. Change tracking and collaboration was enabled on the document, which meant Clive could read comments made by various users.From the senior management level, there were comments like, “It doesn’t matter how expensive it is.” Accounting warned, “We won’t have the money to pay annual bonuses, if we do this!”Brandon had left his own note: “Our business is too special. They will fail. This is a waste of money. They will fail.”The pieces clicked into place. Brandon hadn’t been making a prediction; he was making a promise. And he’d kept it- there was no way that Clive and Lee could deliver what was originally promised in the next few weeks.Then an email from their recruiter arrived. “That company still wants added staff. Do you want to re-up for another six months?”Having learned from Brandon, Clive sent a one-word reply: “No.”[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!
Coded Smorgasbord: Classic WTF: Holiday Smorgasbord
Your Christmas present this year is a pile of WTFs from back in 2005. A veritable holiday smorgasbord. This post wouldn't be here if it didn't exist. --RemyIt's been a while since I've done a smorgasbord post, so here goes ...DM discovered the source of some rather ... unprofessional ... error messages in the log files ...
The PM Who Stole Christmas
It’s Christmas Eve, and that means we’re taking a little break from writing new articles. Starting next week, we’ll re-run all of the best articles of this year.For today, though, while I was working on The Glitch Who Stole Christmas, I got a bit inspired, and maybe a bit carried away.
The Glitch Who Stole Christmas
CodeSOD: The Apple Genius
Apple refers to their in-store technicians as “geniuses”. Everyone on Earth knows that it’s nothing more than cute marketing and is a meaningless title.Well, almost everyone. Derick worked for a company where the CIO worked at Apple’s HQ at some point. Said CIO was quite proud of this achievement, and made sure everyone knew it. He wasn’t happy that his new startup had decided to use C#, but it was okay: he was ready to reinvent core pieces of the .NET framework to avoid having to deal with whatever bombs Microsoft had snuck in.And he was going to optimize it.
...51525354555657585960