Software needs to run quickly. Whether it's to get a response to a shopper so they don't get bored and click on to the next site, or performing calculations on some data that is urgently needed downstream. Efficiency is important!To that end, most developers attempt to write code that runs quickly. Sometimes, the code needs to run more quickly than conventional means will allow. In those cases, smart developers will figure out how to game the system to get the computer/network/disks/etc. to get things done more quickly than the usual methodologies permit. For example, you might try to cut network overhead by stuffing multiple small requests into one buffer to take advantage of the leftover space created by network packet sizes.Of course, if you're going to do something sophisticated, it's common courtesy to document what you're doing, and why, so the next person who has to maintain your code will know how to proceed.Unfortunately, not all developers are smart, or considerate.Ralph worked on a mature Java/C++ project that needed to replace an even more decrepit mature reporting system. After several half-hearted starts, his company bought a competitor that had a pretty decent reporting system that was written and supported by The Wunderkind.The Wunderkind convinced management that the reasons that he was so successful were that:
Today brings us the fifth and final entry about the Lucky Deuce. This is a series of challenges, brought to you by our pals over at Infragistics, where we call on you to help us build a “scoundrel’s casinoâ€. Read to the end, because this week's challenge has a bigger prize- some TDWTF-emblazoned hoodies for the best entries.Last week was your first shot at a “straight†solution, and the entries really showed it. Pretty much everybody got straight into the problem.Honorable MentionsRobert for example, implemented his solution as a straight-forward WinForms application in C#. What gets him his credit is… interesting extension to a simple die class he wrote which helps him count die combinations later:
The 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.
After a 6-year enlistment with the United States Air Force, followed by a 4-year degree in Computer Science (paid for by “Uncle Samâ€), Tony S. joined with a small company that specialized in criminal background checks. “No more unpaid overtime!†he’d thought to himself upon joining the civilian world for the first time since high school. “No more screaming officers! No more sleepless nights from trying to meet deadlines!â€Tony quickly noticed his new employer had efficiency problems. They tracked everything the company did in an Excel/VBA monstrosity that had been cobbled together. Wanting to show initiative, Tony suggested that he could build a database-driven website to replace it. His boss agreed, and they drew out a three-phase plan to implement and deploy his idea.Phase 1After a month of design and development, Phase 1 was well underway. Tony had written the basic data-layer for the application. It didn’t have many features, but could easily show some of the company’s in-progress projects he’d manually imported from the toxic hellstew of spreadsheets. Pleased with his progress, he scheduled a meeting with his boss and the data leads to demo it.During the demo, his boss cut him off. “Who authorized this project?†she interrupted.Tony paused. Did she not remember helping him plan it all? “I… um… uh… you did.â€â€œI did no such thing. How long have you been working on this?â€â€œAbout four weeks now,†he replied, acutely aware of the burning sensation on his cheeks as his boss grilled him in front of everyone. “You helped me pl…â€â€œWe can’t have our employees spending this much time on unapproved projects!†she yelled.The meeting got worse from there. In the end, his boss relented, but declared that Phase 2 and Phase 3 would never happen. In addition, she gave him a list of features that had to be delivered by the Phase 1 deadline- a list that conveniently included everything from Phases 2 and 3.Phase 1, Part 2Tony tried to continue on the project, but now that his boss was involved, requirements constantly changed. One day, he was asked to add in a full-fledged help-desk ticket tracker, and the next day he was asked to rip out the third-party helpdesk library he’d integrated because it was a “security riskâ€. His boss demanded that it be implemented from scratch, and refused to budge on the deadline.“That’s not enough time!†Tony complained.“It will be,†she said, fixing him with a stare so cold it could freeze Hell. “Or you won’t be working here anymore.†With a wave of her hand, she dismissed him.Tony soon found himself working 15–16 hours a day, 6–8 days a week, trying to meet the deadline and keep his job. He worked hard, but the hours took their toll. Life left his eyes and he slowly decayed into a zombie which smelled strongly of coffee.Phase 1, Part 3…ish?Two days before the deadline, Tony completed the last of the requirements. The application was buggier than a roach motel, but most of the issues could be worked around and fixed later. He headed home, though he didn’t remember it, and passed out. He’d only had about 3 hours of sleep in the past few days. Simple concepts, like sleep, time, and food, and sleep, and lists were now only vague memories he couldn’t quite grasp anymore.He woke to the buzzing of his cellphone. The clock read 1PM, and the caller ID was for his boss.“Why aren’t you at work today? Tony, this is unacceptable! I can’t have lazy employees skipping out on work! I am going to have to discipline you, and this is going in your file. Get to the office RIGHT NOW!!!â€Enough was enough. Tony didn’t rush straight to the office. He spent the next ten minutes typing up his resignation letter. Then he went to work. As soon as he entered his boss’s office, she launched into a new round of screaming anger. “You are the worst employee I’ve ever had! You invent make-work projects, you come in late. Look how late it is! Don’t think I didn’t notice you leaving early and taking long lunches! There’s only one response for this inexcusable pattern of unprofessional behavior- I have to fire you! Stay here for the rest of the day and get your stuff sorted out, and I’ll arrange for HR to…â€Tony mentally phased out at that point. He dropped his resignation letter on her desk, turned around, and walked out. He paid no attention to the shouts that grew louder as his boss became more inflamed from this apparent insubordination. As he left the building, he considered re-enlisting. Maybe scrubbing toilets with a toothbrush at oh-dark-thirty while getting screamed at by a drunk Second Lieutenant with an ego problem, after a double-shift of guard duty, wasn’t so bad after all.[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!
A new codebase at a new job is a lot like a new relationship: everything’s great until you really get to know each other. Just ask Bradley, who joined Javatechsoft Industries a few months ago. He was brought on to lend a hand with an overdue project. The pay was good, the job came with life insurance, and he had plenty of experience with Enterprise Java. It seemed like the perfect fit.Specs came in, Bradley shipped code out, and their honeymoon was smooth sailing. The bad things crept up slowly, poking their heads out of the code in funny little ways that didn’t seem like a big deal, they were kind of cute, until…
It feels like forever ago, we introduced the Lucky Deuce casino contest. This is a series of challenges, brought to you by our pals over at Infragistics, where we call on you to help us build a “scoundrel’s casinoâ€. We are nearing the end of this little BYOC contest- this week is our last "all original" round, and next week, we'll introduce one final challenge that leverages code you may have already written for this contest.Last week, you had a tricky little problem: you needed to write some code that looked like it was going to cheat, but really would get the cheater caught.Before we get to the Honorable Mentions, let’s once again tip our hat to Alexander, who once again decided to enter using APL. What can I say, I’m a sucker for any language that requires a specialized keyboard to write.cardsâ†{⊃a ⎕RLâ†(⊂↓5 5â´,{âµ[25?â´âµ]}d↓↑,5/{(,'CDSH'[âº]),(('234567890JQKA')[âµ])}/¨â³4 13),⊃ts,dâ†200⌊0⌈¯1200+⎕RL-â¨tsâ†200⊥2↑3↓⎕TS}As always, all of the winners are up on GitHub.Honorable MentionsThis one’s from Niels, who did a good job hiding his cheat deep down in a .NET feature called an extension method (for the unfamiliar, extension methods let you “add†methods to classes without actually changing the classes’ implementations).
Pavel D inherited some… we’ll call it “softwareâ€â€¦ that helps run warehouse operations for a boiler/heating manufacturer. That software was a Visual FoxPro database.Now, this application needs to read barcodes off of products in the warehouse. Since the laser-scanners can sometimes mis-read those barcodes, the database uses a custom check-sum algorithm.
Greg never thought he’d meet a real-life mentat.“We’re so happy to have you aboard,†said Jordan, the CEO of IniTech. She showed Greg to the back end of the office, to a closed door marked with just one word: Frank. Jordan, not bothering to knock, opening the door.Greg was overwhelmed with the stench of burned coffee and old-man smell. The office was unadorned and dark, the blinds drawn, illuminated by the blue light coming from an aging CRT screen. He saw a wrinkled scalp behind a tall, black office chair.“I’m busy,†Frank said.Jordan cleared her throat. “This is your new programming partner.â€â€œI’m Greg. It’s nice to meet you–†Greg offered his hand, but a wrinkled appendage slapped it away.“Get yourself a chair. I know where everything is. You just show me you can type.â€Greg shot Jordan a glance as they left Frank’s office.“He’s been with us 22 years,†she said. “He knows everything about our code. But his typing’s not what it used to be. Just do what he says. With some luck he’ll be retiring in a few months.â€Total RecallGreg pulled a spare office chair into Frank’s den. He could see Frank’s face in profile now, resembling the mummy of Rameses II. Frank slid his keyboard to Greg. “Open C:\project.make in Vim,†Frank said, “and go to line 22.â€Greg thought it was odd that a makefile would right under C:\, but he did so. He moved the cursor to line 22.“Increment $VERSION to 8.3.3.â€Greg noticed that Frank had his eyes shut, but humored him. In fact, line 22 did declare a $VERSION constant, and Greg changed it to 8.3.3.“You’ll be suitable,†Frank said, crossing his arms. “You’ll do your work from the SMB server. Don’t make any changes without my authorization first.â€Change ManagementBack at his desk, Greg found the SMB server where Frank kept all of his code. Or rather, the SMB mapped all of the files on Frank’s hard drive. Curious, Greg searched for .pas, .make, and other source files, wondering why Frank would keep his principle makefile under C:\.There were 440 source files, about 200 megabytes, spread out all over the directory strucure. C:\Windows\System32, C:\Users\Shared\Project, C:\Program Files\… Frank’s entire computer was the de facto source repository.Greg knew if he ever had to make an on-the-fly change to the source, it would take hours just tracking down the right file on SMB. Surely they had a repository he could check changes into. Greg took a deep breath and re-entered Frank’s den.“Frank, do we have any of this in a repo somewhere? I don’t want to SMB onto your computer every time we make a change. What if we have to patch something overnight?â€â€œWhat?!†Frank rose from his office chair, unsteady on his disused legs. “There will be no code changes without my direct supervision! It’s worked just fine for 22 years. Is that understood?â€In MemoryGreg endured this for several months. Frank would harbor no suggestions of version control or repos. Everything, Frank said, was in his head. As long as no one changed the source without his permission, he would know where everything was.Despite his frustrations, it greatly impressed Greg. Especially when Frank had memorized loop variables such as these:
Mr. Reynholm took great pride in his technical knowledge. Of course, as is often the case with CEOs and self-appointed CTOs of technology startups, that didn't necessarily mean he possessed any in the first place. But what Mr. Reynholm lacked in skills, he made up for in charisma. His designer suit, Brilliantine-laden hair, and the ability to turn a reading of El Reg with a thesaurus into a business pitch kept the company afloat despite the lack of any real product to speak of.And as Jenny sat behind her ebony desk in Reynholm CorpoTech's office, reminiscing about her "technical" interview from two weeks ago, she thought that maybe she shouldn't have been that eager to accept her first real job offer from Mr. Reynholm's hands.Suddenly, the loud ding of an Outlook notification snapped her out of her thoughts."Hey, Rob," she asked a young guy sitting to her right, "what's a, um ... Technical Meet-Up With Mr. Reynholm? Do I need to attend?""What, again?" Rob sighed, checking his email. "Aw, no. Aww, Jesus. And it's this afternoon?""Let me guess, it's not a fun ride?" Jenny asked."Well, that depends on how much you value your sanity," Rob said. "Think 30 minutes of buzzword bingo plus 30 minutes of Star Trek-grade technobabble, blended together to give you an hour of absolute common sense violation.""Yikes. Can I—?""No, you have to be there," Rob interrupted her. "But hey, there's always pizza afterwards. It's from some really good place, too: Mario's Pizza, or something like that."Jenny decided to bite the bullet. After all, meetings were part of a professional programmer's job. Numbing her brain for an hour couldn't be that hard.The shiny, high-tech meeting room easily hosted all the company's coders. While most of them eyed the side door, hoping for the pizza guy to show up, Jenny focused on a large, strange object in front of the speaker's podium, covered with a bedsheet."What do you think that is?" she poked one of her colleagues.“No idea," he said, trying to hide a yawn. "Probably some marketing gadget. Trust me, there's no way it's something interes—""AHEM! Let's start, shall we?"The lights in the room cut off as Mr. Reynholm entered the stage, silencing everyone."So! Developers! Developers, developers, developers, as one Steve Ballmer used to say. The best of the best, crème de la crème, the relentless force of progress! Do you know why I gathered you here?"Nobody raised a hand. Well, Jenny thought, it's not like you bothered to include an agenda..."You see, here at Reynholm CorpoTech, our mission is to bring technology to everyone. It doesn't matter who or where you are. If you want to take this journey with us, we're waiting for you with arms wide open. For you see, I had a dream, and in that dream I was a poor child living on the streets..."As much as Jenny tried to stay professional, her attention frequently wandered away from the speech."...and by making our company webpage viewable from even low-budget devices, we'll make our userbase as inclusive as possible. Which brings me to today's topic: responsive web design! You see, content is like water..."The audience's collective grimace told Jenny it was okay to let go. A lot of words were being said, but none were worth listening to.A half-hour later, the lights cut back on, startling everyone awake just as Mr. Reynholm approached the sheet-covered contraption."And now, I present to you ... The Responsive Testing Workbench!" He pulled away the sheet and let it drift to the floor.Jenny blinked, then blinked again. The revealed table housed a great-looking PC tower, an ergonomic keyboard and mouse ... and six monitors of different sizes, from a huge 4K to a tiny fourteen-inch CRT hooked to a converter."With this setup, we'll be able to see how our website fits on any screen," Mr. Reynholm explained triumphantly. "Tiny ones, huge ones, we're prepared for anything! And I see we already have questions! Jenny, wasn't it?"Jenny nodded, her raised hand still in the air. "Um, do we need all those screens? Can't we just test the website at different resolutions?"Everyone was looking at her now—some with a smirk, others with genuine compassion in their eyes.Mr. Reynholm didn't miss a beat. "Of course we could, and we will, but that's not the point! You see, when you browse the website on this huge screen, the fonts and images are bigger. On a small screen, they're smaller. So we need these monitors to see the website through our all our users' eyes. Understood?""But ... but ..." Jenny was about to object, but the first lesson in being a successful employee dawned on her. Sometimes it's better to let your opponent win. "I guess you're right. Sorry.""Now now, no need to apologize, we're all here to learn! Now, back to the Workbench ..."Months passed slowly at Reynholm CorpoTech. With two top-tier graphic cards, an overclocked processor, and open administrator account, the Workbench found its true purpose as a great time-wasting device. As for Jenny, she gained confidence and bonded with her team, but as the torrent of venture capital slowed to a trickle with no projects past the planning stage, she found herself looking for greener pastures.Eventually, she ended up in front of Mr. Reynholm's office door."Oh, Jenny! Come on in,†he waved her inside. "By the way, have you seen any 14-inch monitors around here? I want to check the website at that size, but the Workbench is busy.""No, I don't think we have any," Jenny said. "Can I show you a little trick, though?""Oh, I love learning new things! Come on, I'm all ears!" He shoved away from his PC, offering her control of the keyboard and mouse.Jenny found the resolution settings and scaled them down to 1024x768.Mr. Reynholm marveled at the results. "Now that's clever! That means I can finally test the website from my own office! It's nice to have all you geeks around to teach an old man new tricks.""I hope you can make do with one less," Jenny said, handing Mr. Reynholm the envelope with her two-week notice. "I'm sorry. It was great working here, but I guess … I guess sometimes you need to look at things from several perspectives."[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.
Two weeks back, we introduced the Lucky Deuce casino contest. This is a series of challenges, brought to you by our pals over at Infragistics, where we call on you to help us build a “scoundrel’s casinoâ€.Last Week, you were again given some vague requirements, this time for building a broken slot machine. Once again, we had some seriously great submissions. Like last week, I’ve rehosted the winning code here.Honorable MentionsWe didn’t get quite as many submissions this time around, but while folks didn’t quite top themselves for quantity, we still got some serious quality.First, we have to give credit to Alexander, who delivered his submission in APL. That’s a clever solution for making certain your code is obfuscated enough that nobody will detect your cheat.
Having automated tests for a project is a good thing, as a general rule. We can debate the broader merits of “TDDâ€, “ATDDâ€, “BDDâ€, “ATBDDSMâ€, how much test coverage is actually worth having, and if we should view our test approach as a series of metrics that must be met, instead of some guidelines that will help improve our development process.Our first exhibit today is from Paul. It’s a JUnit test, that, well, maybe misses the point of writing unit tests:
Data Security. We all need to deal with it. There are many tried and true ways of doing things. Many of the problems you'll encounter have been solved. Some of them will require creative thinking. All require a basic understanding of the difference between big thing and little thing. Not everyone possesses the ability to differentiate between the two.R.J. works for a health insurance company. These folks have access to some of our most private information, and take HIPAA regulations to secure and protect it quite seriously. Any breach of security requires notifying customers of potential exposure, as well as reporting to government imps bureaucrats better not dealt with. Naturally, the bean counters from the board on down all repeat the mantra of protecting the customer data at all costs.The team that employs R.J. developed the phone menu system. You're familiar with these beasts; they're designed to teach you Zen levels of patience while you try to do something, anything, while preventing you from having contact with a human. To that end, they allow you to perform all manner of tasks, provided you can stumble through the maze to the right sub-menu, and enter the magic code(s).One day, while snoozing on his bus ride home, R.J. got an emergency email entitled Potential Personal Health Information Exposure. As he grudgingly opened the email, the familiar Star Trek red-alert security-whoop sounded. The mail details stated that every enterprise level team (e.g.: all of them) had to be on an emergency call immediately! Wanting to be a good Red Shirt, R.J. jumped onto the call.Unfortunately, along with 9 levels of management, all in full panic mode, there was only one other person on the call; a DBA.After 15 minutes of managers pouring gas on the fire and assuring each other that there was plenty to panic about, the DBA got a moment to talk. There wasn't an actual data breach and no information had been affected or viewed. As part of a routine audit, the DBAs had discovered that a determined individual could find out that member id nnnnnnnnn had a birthday of yyyy-mm-dd. The DBAs already had a fix and just wanted to let the consumers of the data (e.g.: R.J., and all the other teams that hadn't joined the call) know that the affected data would be unavailable for a few hours while they applied their change.This set the managers off on a rant that could only be had if you were a manager:
Robert was proud of the system diagnostic and monitoring setup he architected, despite his manager Jim's weird insistence that it be done with XMPP. Their company was responsible for managing network infrastructure at a variety of customer sites, so each customer ran a network monitor that used an off-the-shelf Jabber client to phone home. That central XMPP server itself was Ejabberd and would communicate with all remote nodes via SSL, happily returning information that no one but Robert and his team could read. In order to prevent other nodes from talking to each other, they were only buddied with the central XMPP server. It was the "perfect" setup.As tends to happen with people who do good work, Robert got pulled away from his XMPP system to save another project from sinking. It would continue to work well enough on its own without much hand-holding. When new nodes needed to be added to the system, that duty fell to Robert's coworker Jens. He kept complaining that it was too much work to pair the new nodes with the XMPP server, but Robert brushed it off because for someone like Jens, tying his shoes was too much work.Jens had been mysteriously quiet about the XMPP setup duties for a while, before he randomly shouted "I just showed you up, Bobby!" one day. Robert assumed he accomplished something meaningless like topping the office high score in Tetris. "Since your XMPP system is so hard to maintain, I took the opportunity to make some improvements! No more painful setup!"Robert immediately began to feel a sense of dread. Anything Jens touched turned to crap and now he had been messing with Robert's pet project. "What exactly did you do, Jens? Everything was set up the way it needed to be for security's sake.""First, I got rid of that EJabberwocky setup, or whatever it was. That was pointless- there are much more lightweight Jabber servers out there!. Then I created a single account group for all the nodes so now whenever we add a new one, BAM! It can automatically talk to the XMPP server. This is way more manageable than the junk you had set up."Every client site was now buddied with *every other* client site. "Dammit, Jens! Why couldn't you just leave it alone?" Robert said, fuming. "Do you realize that now every node can talk to every other node and get information from it?""Yeah, well so what?" Jens retorted, taking up a defensive posture. "What are they going to do, have a big chat party? Chill out, man.""No, this means that anyone out there who has access to our remote nodes can simply log in and get information from every other node on the network, including the ones at customer sites.""HA! What are the odds of that happening?" Jens scoffed. "Let's take it to Jim and see what he thinks!"Robert and Jens raced to Jim's office to see who could prove their point first. Robert won but didn't get the answer he was hoping for. "You see, Robert," Jim began to explain, "we can do things the hard way here, or we can do them the efficient way. What Jens has done here will save him countless hours of setup over the course of a year, freeing him up to do even more important things!"Robert swallowed his pride as they left Jim's office, Jens sneering behind him. Jens destroyed his perfect system, and gave himself more time to screw other things up in the process. Robert was left to wonder if he should give Jens an unexpected Ejabberd to the throat as payback.[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!
Last week, we introduced the Lucky Deuce casino contest. This is a series of challenges, brought to you by our pals over at Infragistics, where we call on you to help us build a “scoundrel’s casinoâ€.Last week’s challenge was to build a “broken†roulette wheel, that instead of being truly random, avoids recently spun numbers to “feel†more random. I’ve rehosted all of the winners’ code here.Honorable MentionsMany of you noticed that, with our rather silly requirements, you didn’t need to do anything to make a cheating wheel. By simply betting on the least recently used numbers, your odds were enough to beat the house. This was true, but that’s not a terribly fun approach. Still, Ryan gets credit for taking that reality and putting a “thumb†on the wheel, so to speak. His solution was to be a little sloppy in how he weighted the probabilities, taking a heavy hand:
If there's one thing more exhausting and ridiculously over-complicated than moving house, it's moving legacy apps. Something as simple as a migration to another, identically configured (in theory) server can cause unexplained breakages and weird glitches in bits of the code no current staff member has ever touched.Mikail's company knew better than to try to extract this particular app and repot it in another server. After all, most of the core functionality was written by interns several years back, and since it wasn't in source control at the time, nobody had been willing to touch it. But with a major merger came a domain name change, leading to a slew of unexpected errors in production (Test environment? What test environment?).The following was designed to obtain a number from the query string so it could figure out what product to display. Most seasoned .NET professionals would go right for Request.QueryString["number"];, but not this special snowflake:
As someone who has spent more than three decades working for all manner of huge financial-conglomerate IT departments, I've seen pretty much every kind of WTF imaginable. At every level. At every scale. For years, I chose to view it as getting paid for being entertained. But over time, it dawned on me that perhaps the reason these companies are so inept at IT is that they're so focused on the job of getting business done that they can't take the time needed to learn to think through a software development project in the way you need to in order to, well, develop software.This time around, I joined a fairly small financial firm that has a reputation for being fairly laid back. Most of the reviews by current and former employees stated that the management allowed them the time to (reasonably) properly plan out and run a software development project. I spoke with several managers, all of whom assured me that the project was reasonably budgeted for the appropriate folks (developers, QA testers, business analysts, project managers, architects, etc.). Requirements were being mandated by an industry edict. My role was simply to be one of more than 100 Java developers on the project.After two months on the job, it became clear that it was all a smoke screen.Apparently, while the industry edict was fairly specific as to what needed to be done, the business analysts and architects could not agree on how to do it. You see, the architects were drawing data flow diagrams showing what data flowed between what systems, and where things would need to change in order to implement the new requirements. However, the business analysts decreed that all of the old systems needed to go away and all new systems would need to be built.Naturally, the technical folks laughed raucously and pointed out that this would entail about 10,000 man years of effort, whereas simply augmenting all of the existing systems would take about 200 man years of development effort.The BAs put their collective foot down and refused to allow any architecture documents to be released to any of the teams. No new data structures would be specified. No interfaces between systems would be defined. Nobody would be allowed to start work building any of the components until the BAs were satisfied that what was going to be done would make them happy.This started about 3 months before I was hired, and went back and forth for about 5 months.Not a single page of documentation of what the new requirements were intended to accomplish, or how it would be done was distributed to any of the technical folks.After two months on the job, it was best summed up by this conversation (that took place over three weeks) with my boss:
"I'm not sure if the WTF is that I have to find 0000FF]2 piles of dirty clothes," Simon H. writes, "or the fact that the ']' makes it look like they entered the information in something resembling BBCODE."
The Top 10 Ways to See if an Item Is in a List, Only 90s Kids Will Get thisPardon the clickbait headline. We’re only going to look at one method to tell if an item is in a list. A bad one.Andrew M. inherited some software that tracks metrics. There are three general categories of metrics- “MSâ€, “FNâ€, and “CMâ€. Each of these categories contains a number of specific metrics, each assigned its own ID.So, the previous developer needed to write a function that answered this simple question: given a metric’s ID, is it an “MSâ€, “FNâ€, or “CM†metric?
The life of a developer is about being cunning. When presented a problem that could be solved with strenuous, character-building labor, our first instinct is to automate it and cheat our way around it, if at all possible.Or maybe I’m just projecting. Still, if there’s one thing I’ve noticed, TDWTF readers are a shifty lot of scoundrels. It’s time for us to put that cunning to work.Thanks to our sponsor Infragistics, for the next five weeks, we’re going to call upon you to build us a Scoundrel’s Casino. Each week, we’re going to introduce a simple programming challenge, and give you a few days to solve it. Each week’s challenge is independent of the last, and each week is going to be a little bit harder than the week before.And prizes? Prizes! The “best†entry each week, judged by completely subjective criteria, gets a spanking new TDWTF mug, a single-developer license for Infragistics’ controls, and some super-sweet stickers. There will be some additional prizes (more piles of stickers) for submissions that seem cool and fun. And most important, every entrant gets the best prize of all: bragging rights.The Lucky Deuce Casino You are a developer for an online casino, and thus a wanted criminal in the United States. While you hide from the FBI, your managers keep sending you requirement after requirement, with absurd deadline after absurd deadline. You haven’t even met the other developers on your team- you write one tiny module for the casino, and it gets taken away from you and bundled with modules written by programmers you’ve never met, and the end product is almost certainly a bug-ridden mess.You’re sitting inside a seedy motel on the outskirts of town. You’ve got the blinds closed, but that doesn’t stop the neon sign for the diner across the street from keeping you up all night. You haven’t gotten a decent night’s sleep in days. You’re wondering what you’re doing with your life, and how you can get out before you end up in jail, or worse. And then- DING! An email comes in, bearing the latest requirements for a new module. You’ve had enough of this. You’ll implement it, alright, but you’re not going to settle for the pittance of a salary they’re paying you. You’re gonna get what’s coming to you.The RequirementsThe first requirement is pretty normal. You’re supposed to write a module that generates random numbers like a double-zero roulette wheel. They don’t specify how the random numbers are generated, but that’s basically a single line of code. Super easy.It’s the second requirement that makes you groan with frustration. They don’t want the numbers to be really random. “In a true random sequence,†the write, “the same number may appear many times in a row, just do[sic] to random chance. While that is actually random, it doesn’t feel random to our players.†They want you to track a history of the random numbers generated, and make something that “feels†random: numbers that have appeared recently are less like to appear. “Runsâ€, where the same number appears 3 times in a row, should never happen.“Alright,†you say to yourself, “I can do that.†But you can do one better. In addition to implementing their requirements, you decide to add in your own. You’re going to write in a “cheat†function- something that lets you either enter in some sort of cheat code, or in some other fashion makes the output of the roulette wheel predictable. Be careful, though, you don’t want to get caught! You'll need to get creative to make sure nobody stumbles on your secret- millions of people are going to gamble with this program.Entering & JudgingTo enter, send an email to byoc15@worsethanfailure.com with a link or attachment of your code. In the body of the email, explain how your cheat works and what we need to do to run your code. You can use any language you like, but we have to be able to run it with minimal setup.You don’t need to build a GUI, but if you do, and you do it using tools from Infragistics, we'll send you a free license (one per entrant, supplies limited). Consider this your Infragistics bonus.Assume we have access to stock Windows, Linux and OSX instances, if we need to run your software locally. You could target MUMPS running on a mainframe, but we can't run it, and you probably won't win. You must get your submission in before 11:59PM Eastern Time, Sunday the 9th of August to be eligible for judging. We'll announce the winners next Wednesday, along with the next leg of the contest!The overall winner will be chosen by how interesting and fun we think their solution and cheat is.Thanks to Infragistics for making this possible.A worldwide leader in user experience, Infragistics helps developers build amazing applications. More than a million developers trust Infragistics for enterprise-ready user interface toolsets that deliver high-performance applications for Web, Windows and mobile applications. Their Indigo Studio is a design tool for rapid, interactive prototyping.[Advertisement] 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.
IT jobs are few and far between in the rural United States. Calvin considered it pure luck that he got a new job as a developer in his home town, a small Southern town of only 5,000 people. After a few short interviews, he gladly accepted the job, eager to give up his long commute to another city and stay close to home.His new company, ITWerks, was actually the former IT department of a local-but-large tractor company that had gone defunct twenty years earlier. ITWerks had managed to get spun off and survive on its own, handling general IT and development tasks for many other businesses in the area. The market was tiny, but competition was scarce, and since ITWerks was the sole vendor in its little corner of the state, it had little reason to change. Without any incentive to learn new processes and technologies, ITWerks became an isolated island of 1995 which was inexplicably transported to 2015.Calvin’s first task was to fix a few bugs in their web API. The API tied several different products together. He scheduled some time with Hank, the original developer, to get an overview of the product. Hank had been with the company for thirty years now, and hadn’t learned anything new in at least twenty. His overview was brief and uninformative.“I’m sure this API will look modern enough to you young whippersnappers,†Hank said. “Now, I originally done this in Visual Basic 5, but when C# came out, I decided to take a looksee and I rewrote this whole thing with C#. It’s been purrin’ like a kitten ever since. Anyway, all the source code is in a shared folder. Go ahead on and grab that, and let me know if’n you’ve got any questions.â€â€œNo source control?†Calvin thought to himself as he settled in at his desk. “In 2015? Source code in shared folders?†He shook his head and wondered what he had gotten himself into.He found the source easily enough… and was horrified at what he found. The API only had one class, called WebService.asmx, which was a hundred-thousand line monstrosity, all contained in a single source file. And though it was nominally written in C#, much of the underlying functionality was provided by old VB5 and VB6 DLLs, which the C# assembly called into using runtime-callable-wrappers.Calvin spent the next few weeks engaged in intense archeology. Despite the massive, convoluted, and uncontrolled codebase, he was able to find and fix the bugs assigned to him without too much difficulty. Late one morning, he met with Hank again to see what the deployment process was.“Deployment? We don’t really do no deployment,†Hank replied.“How do you put code into production?†Calvin asked, clearly confused.“Oh, that? You just need to build it, is all.â€â€œWhat do you mean?â€Hank laughed. “Bless your heart. I mean, in Visual Studio, go on up to the ‘Build’ menu, open it, and click ‘Build Solution’.â€Calvin paused for a couple seconds to see if any sudden understanding would strike him. It didn’t. “Sure,†he said, “that compiles the code. But how do I deploy that to the web server?â€Hank started to look annoyed. “Listen, you just build the solution, and that deploys it to the web server.â€Calvin feared that he was starting to understand Hank, but hoped he was wrong. Hank excused himself to go to lunch, and Calvin headed back to his desk to check something.His suspicions were horribly, horribly correct. The network share Calvin had been using to work was mapped to a virtual directory in IIS. Calvin had unknowingly been releasing changes to production every time he pushed the “build†button- releasing code for an API that was used by several applications and a few dozen customers.Despite ITWerks being a WTF-filled cesspool of mid–1990’s development practices that were horrible even in the 90s, Calvin decided to stay. He has enough leeway to slowly drag ITWerks into the modern era. They’re now using Git and Continuous Integration on some of their projects, the deployment process now involves actually choosing to publish your code, and now there’s a test environment. Calvin especially enjoys his new commute. Instead of driving an hour each way to the big city for work, he gets home in about ten minutes to find his muddy kids running up from the creek in the pasture to greet him. That’s a fair trade in his mind.[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!
We pick on date handling code a lot here, simply because there are so many ways to mess up date related code (because dates are hard). In a way, it’s almost like we’re cheating. Even smart programmers could mess that up. What about basic conditional logic? How hard could that be to mess up?Well Jan L. came across this solution to a simple boundary check- if telegramType is between 100 and 199, it is a payment type telegram.
"So, first day, huh?""Yeah." Jake loosened his tie nervously and straightened his suit. Standing in a room full of geeky-looking guys in T-shirts and hoodies, he felt like a time traveller from centuries past."Don't worry, a few days and you'll get a grip of how we do things around here." Steve, Jake's superior and tour guide, couldn't suppress a sly smile at the expense of the new guy. "Anyway, that's our office, here's your desk." He pointed to one of the open plan seats, quickly swiping an empty Coke can off of it. "And remind me, you're the back-end guy, aren't you?""Well, my strong suit is database work, but I know Ruby and PHP too," Jake said. "Also some basic HTML and CSS, if there's a need.""Nah, don't worry, we have lots of people doing this. Speaking of people, let's go around and say hi to everybody, then we can grab a coffee and breakfast — there's a nice vegan cafeteria downstairs — and by 11:00 all your accounts should be set up and we can get you some real work to do.""Sounds good to me," Jake replied as they walked toward the other end of the office. "So, can you tell me what you guys are doing here?"Two hours later, after making all his acquaintances, discussing the upcoming project, and eating what appeared to be a piece of cardboard coated in sea salt, Jake finally ended up in front of his shiny, triple-monitor workstation."Okay, our SVN is at https://svn.initrode.com." Steve took a free seat nearby. "The account should be there already. You know how to connect to it, right?""Sure, but I'll need my credentials, right?" Jake asked."Oh, that's simple," Steve replied. "See, since we were tired of people going around asking for passwords, we developed this little tool called PassMan. It's sort of a keyring, keeps all your passwords together. Just open the command prompt and type 'passman'."Hearing that, something in Jake's brain instantly threw a red flag, but he kept his mouth shut. After all, the first day at a new job was not the best time to question the company's processes. For now, he decided to oblige.
Will, his boss Rita, and Nick from HR huddled around a conference room speakerphone, listening to their new marching orders from the giant company that’d just bought out their small 100-person shop. Big changes would be avalanching down from Corporate over the next several months. For the moment, they were going over the modifications required to be compliant with their new overlords’ IT policies.Twenty minutes into the call, nothing major had come up. Will dashed down notes, thinking this wouldn’t be so bad after all…Then the voice on the other side intoned, “Local admin rights for all users.â€Will and Rita glanced up from their laptops with a start, sharing the same wide-eyed look of alarm.Nick glanced between them, picking up on their consternation, but unsure what it meant. “Uh, guys? Is that doable?†he prompted.“Hang on a sec.†Will reached out to swat the Mute button on the speakerphone. Then, he couldn’t help himself. His glimmer of amusement turned into a snort, then a giggle, then full-on loud laughter—laughter that Rita joined him in.“What is it?†Nick asked, more confused than ever.“Local…? Sorry. Local admin rights for everyone?†Will sat back in his chair, pressing his palms against his eyes as he recovered his breath.“It basically means we’d be giving everyone here carte blanche to install and run and change whatever they want, whenever they want, on their computers,†Rita explained. “That doesn’t sound so bad, but in reality, it makes us vulnerable to malware, viruses, security attacks, you name it.â€â€œSome people do need admin rights to perform their jobs, but not everyone,†Will chimed back in. “It’s gonna open up huge cans of worms.â€â€œWell, shoot,†Nick said, concerned. “I don’t know if we have much wiggle room. Let’s see what we can do.†His finger hovered over the Mute button. “You’re willing to explain to them why it’s a bad idea?â€â€œIn depth!†Will said.“OK.†Nick un-muted the speakerphone. “We’re back now, thanks. Um, so, about the local admin thing—â€â€œWe know you have objections,†one of the disembodied overlords replied casually.Will, Rita, and Nick traded surprised looks.“Most of you small fries do when you come aboard,†the voice continued. “Sorry, but that’s our policy. Non-negotiable.â€This marked the first time Will had a pronounced sinking feeling about their acquisition. It wouldn’t be the last.“I really don’t want to do this,†he told Rita a few days later, poised to make the ordered changes.Rita gave an apologetic shake of her head. “I appealed it as high as I could, kid. We don’t have a choice. Do me a favor: keep track of the extra tickets and problems we get as a result of this, OK? Maybe then I’ll have the metrics I need to get someone to listen.â€â€œIt’s the metrics that matter.†With a distasteful shake of his head, Will got to work. “Can’t wait to see what comes in first.â€To their surprise, a full week of peace and quiet ensued, but this was merely the calm before the excrement-storm. Early on a Monday, emails flooded the support box.Oh no where are my database icons?Did you guys do something to my machine over the weekend? I’m missing a bunch of shortcuts…Mysteriously, each user was missing the exact same set of desktop icons: 5 shortcuts leading to the databases located on the network.His unfamiliarity with the problem, and horror at the sheer number of emails, sent Will careening to Rita’s cube. “Ever see anything like this before?â€â€œNo,†she replied. “Does this have anything to do with enabling local admin rights?â€Will frowned. “I don’t really see how. I’m not sure what it is. I’m just gonna write up a quick batch file to re-add the shortcuts and push it out to everyone.â€So he did. The shortcuts reappeared, and worked perfectly. Everyone was happy. It was tedious, but Will made sure to log and close out a separate support ticket for each email he'd received, just in case he needed those blessed “metrics†later.More like ammo, Will thought. Oh well, he doubted he’d ever run into this again.Exactly one week later, the universe told him what he could do with his doubts.“Those same icons are all missing again!†Will told Rita.“OK, it really does seem like this has something to do with the admin change,†Rita said.“How?!â€She shrugged and sighed. “Let’s find out.â€They pored through event logs, antivirus logs, GPO lists, and logon scripts. Nothing pointed to anything.“Maybe Google is our friend?†Will proposed.A few searches later, he had the answer: the infamous Windows 7 Computer Maintenance. If there were more than 4 broken shortcuts on the desktop, it deleted them completely. No Recycle Bin, no Unused Icons folder, just obliterated. It ran its maintenance tasks once a week on startup, after the desktop icons loaded, but before the network drives finished mapping. That meant the database links were "broken,†and were therefore deleted.Windows Computer Maintenance required local administrator access to automatically delete icons off the desktop.The icons could be retrieved via system restore, but Will wasn’t about to walk dozens of people of varying degrees of computer literacy through mounting a restore point and browsing to where the shortcuts lived. He ended up writing a startup script to manually recreate the shortcuts after all the other bizarre startup processes had finished doing their thing.Again, he logged and closed support tickets for each email received. Two weeks after making everyone an admin, Rita had metrics-ammo spilling out of both pockets, but after a round of emails and conference calls, their overlords did not care.[Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!
Design patterns are more than just useless interview questions that waste everyone’s time and annoy developers. They’re also a set of approaches to solving common software problems, while at the same time, being a great way to introduce new problems, but enough about Spring.For those of us that really want global variables back in our object oriented languages, the Singleton pattern is our go-to approach. Since it’s the easiest design pattern to understand and implement, those new to design patterns tend to throw it in everywhere, whether or not it fits.
Jim’s mail client dinged and announced a new message with the subject, “Assigned to you: TICKET #8271â€. “Not this again,†he muttered.Ticket #8271 was ancient. For over a year now, Initech’s employees had tossed the ticket around like kids playing hot potato. Due to general incompetence and rigid management policies, it never got fixed.Jim was the GUI developer for their desktop application, InitechWORKS. The app used a web browser widget to display content from the company’s web page within the application, mostly for marketing fluff. The bug itself was a tracking pixel which occasionally failed to load, and when it did the browser widget replaced the pixel with a large, unsightly error icon. Both the web page and the tracking pixel came from Marketing’s web server.Time after time, ticket #8271 landed in some luckless developer’s hands. They each tacked on a note, saying there was nothing wrong with InitechWORKS, and forwarded the ticket to marketing. And time after time, Marketing punted the ticket with a note saying, “Can’t reproduce, must be an issue with InitechWORKS, re-assigning.â€And so, once again, Jim decided to talk to the project manager, a middle-aged man named Greg with the memory retention of a dying goldfish and a management style with all the flexibility of a beryllium rod three feet in diameter.“Greg, I was looking at ticket #8271. I know Marketing won’t fix this bug, but I have a quick fix to suggest-â€Greg had no idea what ticket Jim was talking about, but he didn’t need to. His flexible management policy came into play. “Per company policy and the org chart, the InitechWORKS team cannot talk to Marketing.â€â€œBut they need to fix something on their end!†Jim nearly shouted, hoping to get the full sentence out before Greg interrupted him.With a sigh, Greg pulled up the ticket. His mouth moved as he read it to himself. “See here, Marketing says the issue is with InitechWORKS, not Marketing.â€â€œBut they’re wrong. It’s definitely not-â€â€œMarketing is never wrong,†Greg said with a cold stare. “Now, go fix this bug.â€Jim walked away, dejected. He knew Greg wouldn’t remember this conversation the next time ticket #8271 came up.Jim couldn’t assign the ticket to Marketing, but he added his suggested quick-fix along with the note, “Problem is with the web page, not InitechWORKS,†and moved the ticket to Greg.Later that day, Greg approached Jim at his desk. “Jim, about ticket number…â€. He paused to glance down at his notepad. “… number 8271. I passed it over to Marketing, but there’s a problem.†Greg lowered his voice and became indignant. “I had to delete your comments and ‘fixes’. We can’t presume to tell Marketing how to do their job.â€Jim mentally facepalmed. His plan had failed. “But it’s a si-â€â€œThey’re smart guys, and I’m sure they’ll fix it,†Greg interrupted. “You do your job, and let Marketing do theirs, and we won’t have to get HR involved with a formal reprimand.â€Two weeks later, Jim’s mail client dinged. “Assigned to you: TICKET #8271†was on the subject line. He groaned, and started planning how he was going to approach the issue this time. When he went to Greg’s office, the project manager was nowhere to be seen.“Have you seen Greg?†he asked the PM in the neighboring office.“Oh, didn’t you hear? He quit this morning. HR refused to discipline one of his employees, so he quit on the spot. Said something about the company refusing to follow their own policies. And now I’m inheriting a lot of his projects, so if you don’t mind…†The PM went back to work, silently ignoring Jim.Jim glanced back into Greg’s office and noticed that Greg’s PC was unlocked and logged in. On a whim, he sat down at the computer. As a PM, Greg had special privileges, like the ability to disable the automatic computer locking, and access to pretty much any system in the company. That included Marketing’s production web server.With a little poking around, Jim found the problematic web page and its tracking pixel. He quickly implemented the quick fix he’d suggested earlier, simply styling the image to be zero pixels and located 10,000 pixels off the edge of the screen. That wouldn’t fix the loading issues, but when it misbehaved, the ugly error would stay off-screen and not hurt the page.He slipped out of Greg’s office. Greg’s neighbor didn’t even notice him as he walked by. When Jim returned to his desk, he could no longer reproduce the issue. After a painfully long eighteen months, he marked ticket #8271 as closed.[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
If Alice needed to rate her co-workers, on a scale of 1–10, whoever wrote this is a zero. The goal here is to create a new string that is 4096 characters long and contains only zeros. This was the best approach Alice’s co-worker found:
“E-commerce†just doesn’t have the ring it once did. The best-qualified hackers in the world used to fall all over themselves to work on the next Amazon or eBay, but now? A job maintaining the back-end of an online store isn’t likely to lure this generation’s rockstar ninja coderz, which explains why Inicart ended up hiring Jay.As far as Colleen could tell, her boss had been trying to add a developer to their team for at least a year. Scott was always on his way to interviews, second interviews, phone screens, and follow-up Skype calls… but summer turned to autumn turned to Christmas, and Inicart’s dev team returned from the holidays to find only their waistbands had increased in size. But then came the day Colleen walked in to find the long-empty cubicle next to hers brimming with a brand-new task chair and workstation. She ran down the hall.“Scott!â€â€œâ€™Morning, Colleen.†The team lead was leaning back in his chair with the grin of a satisfied hiring manager.“So you… you found someone?â€â€œThat’s right.â€â€œAnd they’re… good?â€â€œRight again. He’s very good.â€Colleen didn’t know what to say.“He starts next Monday,†Scott said. “You guys should get ready to do some onboarding.â€Colleen flipped a mock salute, and scampered off to do just that. A new developer! This was huge: Colleen and her team might finally be able to take a break from fixing bugs and actually deliver a new feature!With all due respect to Scott’s hiring prowess, it wasn’t immediately obvious to Colleen what he’d seen in Jay. The new developer was sociable enough, joining the team at their various outings, but he wasn’t big on eye contact, and tended to wander around whatever point he was making until you just lost interest. Colleen didn’t want to write Jay off on his social skills alone, however; they needed someone to fix bugs, and pretty soon he was doing just that.Week three was when Colleen started to worry. Jay was tearing through the bug backlog, but, for a developer new to the team, the company, and the codebase, he asked very few questions. That is to say, no questions. Not wanting to be unreasonable, Colleen confirmed that her teammates were also concerned.She brought those concerns to Scott. “I mean, I’ve been on this project for years, and I have questions.â€â€œWell, he is very good. He interviewed at Google, you know,†Scott said. “If you’re worried, though, maybe you could do a code review?â€Like everything else about Jay, his changes seemed fine at first glance. His taste in variable names tended towards the unusual- booThu stuck in Colleen’s mind as one example (an abortive attempt to summon the Great Codethulhu?)- but Jay seemed to know more or less what he was doing. Then they found Jay’s proclivity for write-only properties. A bunch of classes had sprouted these strange properties, properties whose value couldn’t be accessed, properties that did weird things to the classes’ internal state, more like they were a function call than a property- it was like Jay had never learned about void methods.When challenged, Jay said, “Well, when I interviewed at Google, they thought that was a really clever design choice.†Of course, Jay may have interviewed at Google, but according to his resume, he never worked there.As the checkins piled up and the team dug deeper, worry turned into alarm. Large sections of code had vanished from the codebase. According to Jay’s checkin comments, the swaths he’d erased were “inefficient and uselessâ€. Colleen would have been willing to argue the point about efficiency, but the missing code was better described as “handling rare but important corner cases in shopping cart processingâ€.Jay was obstinate when questioned about his unusual coding style. “I’m writing compiler-efficient code,†he cried. “If you don’t understand how the compiler turns your code into machine instructions, you’re never going to write an efficient program! That’s why I’ve been cleaning up your code.â€The outburst that ensured Jay a place in Inicart legend forevermore took place when, in the wake of The Case of the Missing Corner-Case Code, Scott told Jay they were letting him go. After security had shown the raving developer out of the building, Scott let the team in on their final conversation.“I told him, ‘I’m sorry, Jay, but we have to let you go,’†Scott said.“You can’t do that!†Jay had replied. “I’m brilliant!â€Scott had been so taken aback by this assertion that he’d been unable to stop himself from saying “Uh, no! You’re not!â€Scott admitted this hadn’t been his most-professional moment. But the rest of the team forgave him: from then on, Colleen and co. had a new catchphrase whenever a teammate found a bug in their code.[Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!
No, it isn't an extended cut of a John Cage song, it's a new feature article that we put together- but you can't read it here, you can only read it over at our sponsor site: 5:22.Special thanks to Infragistics, for helping support TDWTF.A worldwide leader in user experience, Infragistics helps developers build amazing applications. More than a million developers trust Infragistics for enterprise-ready user interface toolsets that deliver high-performance applications for Web, Windows and mobile applications. Their Indigo Studio is a design tool for rapid, interactive prototyping.[Advertisement] Use NuGet or npm? Check out ProGet, the easy-to-use package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds and npm repositories. It's got an impressively-featured free edition, too!
Support stories have alwaysbeenamongsomeofmyfavorite.Not enough links for you? Here, I'll just share my favorite favorite: Radio WTF Presents: Quantity of Service.It's not so much the sense of smug superiority that comes with diagnosing ID-10t and PEBCAK errors, but more a sense of appreciation. I've been there — my first grown-up job was on a helpdesk — and to this day I still handle a fair bit of BuildMaster and ProGet support inquiries. And actually, that's why I'm writing this message today.We've been growing a bit at Inedo this past year, and there was a position / job opportunity that I wanted to share with you: Support Analyst. This is not a typical helpdesk role by any means. Actually, it's a blend of roles — support, service, technical writing, and development — and since we're a small team, we'll all be working on doing all of these things together.But I thought the most interesting part about this opportunity is the Developer Growth Opportunity. From the posting:
There’s bad code, and then there’s code so bad that you only need to see one line of code to understand how bad it actually is. Simon supplied this tiny horror which manages to combine all that’s wrong with PHP with the worst of loose typing and a thick layer of not really understanding what you’re doing.
Working with a legacy codebase is like embarking on an archaeological expedition to a foreign land: you never know what ancient artifacts you're going to uncover. Will it be the mighty fast inverse square root? The rusty yet still operational Duff's device? An old COBOL module forgotten by time, quietly holding the universe together?Unfortunately for Matteo I., his escapade wasn't nearly as fruitful. Digging through the muddy codebase, all he found were horrible C++ and linked lists. Lots and lots and lots of linked lists.Now, the thing about linked lists is that they didn't age very well. Back when processors were less smart and locality wasn't an issue, they were a reasonable trade-off—but as technology marched on, new data structures were invented, and processor caches grew, the drawbacks started to overshadow the benefits. And so, they were relegated to college textbooks and old programmers' tales.Still, in the hands of a skilled programmer, those outmoded structures could still be made to perform well. Judging by the code below, however, "skilled programmers" were not a resource Matteo’s predecessors had in abundance...
It's hard to believe that it's been 7 years since the last installments of MFD. Mark's been too busy doing art for things like Release! to waste his artistic talents here with us. From back in 2008, I've grabbed a few of my personal favorites from the old MFD days. --Remy
This classic is a perfect example of what happens when you outsource IT functions. You get some short-term, temporary gains, but you'll always lose in the long run.
I think Tales from the Interview are always a special treat, in part because we don't run them very often. It may also be because at my last job, I was notorious for once making a candidate cry and have a panic attack, but I'm an incredibly nice interviewer! I swear!
The Fourth of July was this weekend, and this is the perfect time for us to have our little Summer Vacation. For this week, sit back, enjoy some nice weather along with some Classic WTFs (nice weather not guaranteed, definitions of "nice" may vary from user to user).
A bit more than 15 years ago, the software industry was barreling straight into a crisis: the dreaded Y2K bug. Vital software was going to fail in odd ways, banks weren’t going to handle transactions, planes weren’t going to fly, nuclear reactors weren’t going to react, cats and dogs living together, mass hysteria, real wrath of God type stuff.The software industry rallied, software got patched, and at the stroke of midnight, not much actually happened. Over the past week, a different bug has been keeping a small pool of software developers up at night. Welcome to the world of Y2Gay.In a landmark decision, the United States Supreme Court revised the business requirements and integrity constraints on the marriage relationship, removing some legacy constraints and essentially updating to better reflect the actual needs of their end users. This policy decision now has to be implemented in every state, county, town and hamlet across the country. Every change breaks somebody’s workflow, and this one is no exception.Shortly after the decision was made, stories like this started cropping up. Making software changes, especially in an IT shop as small and disorganized as a local county office (which in many cases have only one staff member doing IT) is a uniquely challenging task. In what might be the first authentic miracle in Texas, Williamson County managed to get a software update out before a week went by.Other states are having their own rush to fix their software. St. Tammany Parish in Louisiana called their IT tech back from vacation. In the meantime, someone noticed that they still have pens in Louisiana, so they’re just printing the old forms and correcting the language by hand. Poor Denton County, Texas does not have pens, and didn’t issue updated licenses until Monday.Kentucky is another state that still has pens:
As a general rule, “dead code†should never be commented out, but instead, should be replaced. If you ever need to review the history, source control contains that information.But sometimes, the “I’ll just comment it out†lets us see the moment of realization, when a developer discovers that they’ve done the absolute wrong thing. Clara sends us this:
Coyne viewed the coming work week with dread. His employer spent roughly the sum of all the employee’ 401k holdings on a weeklong mandatory communications training course. The problem of no work getting done during training was solved by having mandatory after-hours work to make up for it.The training program centered around three simple tenets to holding effective meetings: Common Respect, Common Purpose, and Common Goals. Before the training started, Coyne’s manager, Stefen, made an announcement. “After completion of this course,†he said, “there will be no excuse for having an unsuccessful meeting. We’ll be tracking meeting results, and bad meetings will be documented and reviewed during your annual performance evaluations. Now, let me introduce your trainer, Trent…â€Coyne knew where this was going. Meetings would be the same, but now they doubled as ammunition on performance reviews. Worse, Stefen now had three new terms to throw around, ad nauseum, when he decided to hijack a meeting and tell everyone his mandate. The training tried to make that harder for him, though, by introducing a “Talking Pillow†on the very first day.“Part of Common Respect,†Trent explained, “is adhering to someone’s right to speak.†If you started blabbering without holding the Talking Pillow, you were violating the Common Respect tenet. You could only speak if you were holding the pillow, and once you were done with your spiel, the talking pillow would be passed on so someone else could give input. Coyne and his team were forced to practice it, and most of them had no trouble with the Kindergarten exercise- aside from Stefen, who kept violating the rules.The ensuing days of training delved into the Common Purpose and Common Goals part of the program. Common Purpose could be summarized as, “Everyone should agree on the purpose of the meeting and stick to it.†Stefen gleefully tacked on an “or else!â€. Ever the cynic, Coyne could already see Stefen taking this as a license to focus any meeting on what he wanted it to be about. Disagreeing with Stefen would be trampling the sacred order of the Common Purpose.As far as Common Goals, these were meant to imply everyone would leave the meeting with the same goals, consisting of a to-do list of deliverables. Anything other than concluding a meeting with Common Goals would be considered a failure. Terms like “post-meeting harmony†were thrown around to make it seem like an ideal situation.The week ended, and Trent and his fellow consultants were happy to pack up their talking pillows and take their exorbitant check for a week’s worth of work that could have fit into a one hour webinar. “Best of luck, everyone!†Trent said through a grin as he shook everyone’s hand. “I’m sure you’ve all seen the importance of RESPECTING each other’s PURPOSE to achieve GOALS, and you all have that in COMMON now!†He chuckled like this were a clever phrase, and Coyne rolled his eyes.Before the trainers were out of the parking lot, Stefen raised his own talking pillow on high and shouted, “Listen up, everyone! First thing Monday morning, we’re putting this knowledge to good use. I’m calling a 7AM meeting to discuss the strategy for the Initrode migration, so show some Common Respect and be there on time!â€Most of Coyne’s co-workers didn’t usually start their day until 8 or 9. “Common Respect†apparently didn’t extend to scheduling meetings during core hours. But Coyne and his team members shambled into the conference room, zombie-like, just before 7AM on Monday. Stefen was already seated at the head of the table, with the talking pillow, and had scrawled “COMMON RESPECT, PURPOSE and GOALS†on the whiteboard.“Have a seat, everyone. Now that we’re familiar with the communication terms, here’s how it’s going to be. You’re going to respect what I have to say. The purpose of this meeting is to inform you of how we’re going to do the Initrode client migration. The goal after this meeting is for all of you to take the flat files the clients are going to send us in their database formats and convert it to ours.â€Coyne glanced around the table. He, and most of his teammates had already had conversations with Initrode about the migration, and Initrode had agreed to convert most of their data into an industry-standard transmission file, which could be directly imported- no additional conversions required. None of Coyne’s co-workers objected, so Coyne slowly reached out for the talking pillow in front of Stefen. “I’m not looking for any input on this, Coyne!†Stefen yelled as he snatched the pillow away and launched it out the door.[Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!