The Daily WTF
Robert H is taking the first steps required to make existing code supportable: writing unit tests. The code in question isn’t that old, it was just developed by someone who didn’t care about mundane tasks, like testing.
They also didn’t care about things like paying attention to web standards, and thus were using the same copy/pasted utility functions they’d been using for a decade.
The application in question was a web application with a large amount of client side code. The navigation system would construct a URL with a query string, then programatically alter the window.location.href property, triggering a page load.
Now, since circa 2016, the “correct” way to manipulate search parameters in every browser that wasn’t Internet Explorer is through the URLSearchParams object, which gives you handy-dandy get and set methods, along with some iterators.
Some organizations might have been (or might still be- the horror!) supporting IE. But
To read the full article click on the 'post' link at the top.