CodeSOD: Living Fossil

This post was originally published on this site

The Daily WTF

Checking browser compatibility is less of a thing these days than it once was. In an ideal world, we check for the specific features we want to use, and fallback to a different approach, or fail gracefully if they don’t exist. We use shims and polyfills and pile on all sorts of logic to navigate this mess.

What we hopefully don’t do is use user-agent sniffing. The user-agent string is, honestly, one of the kludgiest, messiest, and just generally offensive ways to divine browser behavior. It was, however, once the standard, and thus there is still plenty of code, usually older code, which does use user-agent sniffing.

Which brings us to this code, from Megan. It comes from the admin application for a major logistics company for a European nation. This logistics company handles 90% of deliveries for books within that nation’s borders, and is notorious for its buggy software,

To read the full article click on the 'post' link at the top.