- Feature Articles
- Other Articles
Henry was a hotshot developer working on a team that specialized in performance tuning. When other teams in his company had performance problems they couldn’t solve, Henry’s team was called in. Through profiling, analysis of algorithms, and database tuning, his team excelled at turning inefficient, slow, bug-ridden software into applications that actually did real work in a timely manner.
Relational Database are a great way to structure data, but they have their warts. Certain kinds of structures don’t model well relationally, some are difficult to tune for performance, and some queries are just expensive no matter what. Still, with some smart design choices, some indexes, and some tuning of the execution plan, you can make things work.
Hambai approached a tuning problem with that perspective. The database had a huge pile of financial information- stock transactions, commodity valuations, and currency exchange rates. When it was new, queries were fast, but now, years on, performance ground to a halt. One query that drew his attention was one for accessing the latest exchange rate for four different currencies. It was run frequently, and each access took up to thirty seconds.
Perhaps the greatest evil Microsoft ever perpetrated on the world was putting a full-featured IDE on every end user’s desktop: Microsoft Office. Its macro system is a stripped down version of Visual Basic, complete with a UI-building tool, and when used in conjunction with Access, allows anyone to build a database-driven application. Anyone that’s spent enough time in an “enterprise” has probably inherited at least one Access application that was developed but somebody out at a manufacturing plant that magically became “mission critical”. Still, we can’t blame the end users for that.
There’s a special subset of developer though, that when trying to come up with an application that’s easy deploy, chooses Access as their development environment. “It’s already on all the users’ machines,” they say. “We can just put the MDB on a shared drive,” they say. And that’s how Ben gets handed an Access database and told, “figure out why this is so slow?”
Anonymous went to configure some settings and found his options were a little constrained.
Hold your souls tightly, for today, we pierce the veil into the great beyond. We shall examine existential questions and commune with spirits. We shall learn what eternity holds for us all.
First, we must bring ourselves to the edge of death, into a liminal state where time does not pass, where the conscious mind takes a back-seat to the spiritual realm. Mark found this C# code to do the job:
Ivan worked for a mobile games company that mass-produced “freemium” games. These are the kinds of games you download and play for free, but you can pay for in-game items or perks to make the game easier–or in some cases, possible to beat once you get about halfway through the game.
Since that entire genre is dependent upon microtransactions, you’d think developers would have rock-solid payment code that rarely failed. Code that worked almost all the time, that was nearly unhackable, and would provide a steady stream of microtransactions to pay everybody’s salary. But who am I kidding? This is The Daily WTF! Of course reliable in-app payment code for a company completely dependent on microtransactions isn’t going to happen!
One of the hallmarks of “bad code” is when someone reinvents the wheel. In many Code SODs, we show code that could be replaced with a one-line call to a built in, standard library.
That’s one of the the advantages to a high-level language operating on modern hardware. Andrew doesn’t live in high-level land. He does embedded systems programming, often on platforms that don’t have conveniences like “standard libraries”, and so they end up reinventing the wheel from time to time.
Contracting seemed the best way for Ann-Marie to gain a foothold in the IT industry. She wasn't the best or the brightest, and her CV was heavy on toy languages and light on experience. But if she got a good solid chance, she knew her no-nonsense attitude and general intelligence would endear her to her boss.
It’s no easy task combing through the submissions and choosing the right code sample.
Ulysses knows my pain. He recently inherited a Python codebase with plenty of global variables, no convention around capitalizing identifiers, inconsistent levels of indentation, and an AngularJS front end.
Chris M. was a developer at Small Widget Manufacturing. He and his coworker Scott were, in theory, assigned only to developing their in-house ERP software. However, with just one person running the company’s help desk, they often picked up anything considered “software-related.”
A ticket pinged Chris’s inbox: EDI Running Slow. It was from a sales rep named Brett, and like most tickets from sales reps, was marged Urgent. Chris decided to play ball, since Scott was tied up with something else. He called Brett, asking if he could elaborate.
The Daily WTF exists to point out coding horrors, but a few years ago we also took a swing at trying to prevent bad code. Long time readers might remember our 2009 initiative, Code Offsets. We are pleased to announce that Code Offsets are back, redesigned, and ready for you to make a difference (or just to make fun of your coworkers).
Essentially, the idea is simple. Code Offsets are a novel way to offset your (or your co-workers') crap code. Like carbon offsets, which aim to reduce emissions of carbon dioxide/greenhouse gases to compensate, or offset emissions made elsewhere, our Code Offsets are used to offset the bad code that already exists.
Readers of TDWTF know all too well that dates are hard. Strings are also hard. You know what else is hard? File paths.
Like dates, and strings, most languages these days have libraries to simplify parsing filepaths. For example, in Python, you can use the
os.path module to parse out the directory structure, the file, and its extension without too much effort.
The late Seventies was a lucrative time for Finnish-based Kirkniemi Paperi, a paper production powerhouse. Puoval had a great opportunity to cash in on the profits by helping to integrate a completely automated, computer-based production system. His degree in electronic engineering was finally going to pay off.
Thanks to the invention of the Intel 8085 microprocessor, it became possible to turn trees in to paper quicker than ever. Puoval had a mandate from Kirkniemi ownership to spare no expense with getting the system up and running since their biggest competitor implemented a similar system the year before. But if they had a bumpy rollout, it would be incredibly damaging to both the company and Puoval's livelihood.
“Java and C# are kind of the same thing, right?”
Josh was a Java developer, but his company was doing a big upgrade of some .NET applications written years earlier by a developer named Ray. Ray had left the company the previous year, and somebody needed to help port his .NET 2.5 code to .NET 4.0 and a new version of IIS. Josh was a team player, and also knew that newer versions of .NET were almost always backwards compatible, so he didn’t expect it to create that much work for him.
It’s an old joke that Perl is a “write only language”. Despite some of its issues, back in the early 2000s, Perl was one of the best options out there for scripting languages and rapid-development automation.
Speaking of automation, build automation is really important. Back in the early 2000s, before Maven really caught on, your build automation tool for Java was Ant. Ant, like everything invented in the early 2000s, was driven by an XML scripting tool. Since it was tuned specifically for Java, it had some high-level operations to streamline tasks like generating proxy classes for calling web services based on a supplied WSDL file.
Last time, Mercy found out the political campaign she was working for didn't have a candidate that was in his best health- but they were pushing him into the governor's mansion anyway. In today's finale, she confronts a hacker and a harsh reality…
Mercy cringed as Ellis waved her over to his laptop. She left her usual workspace next to the
hamilton server and headed to where Ellis had holed up. On his laptop she saw a YouTube video, playing one of Rockwood’s stump speeches. “We can’t have the YouTube logo on here anymore,” he said, indicating the “Righteous Rants” design. The red and white logo clashed loudly with the Thomas Kinkade-inspired backgrounds Ellis had picked at random from a stock photo site. “Can you make it go away? We can’t be seen to endorse a company like that.”