CodeSOD: The Correct Browser

Sometimes, it's not the code that's bad, but what the code costs. For Elizabeth's company, that cost was significant in terms of dollars and cents. They needed to staff up to accomplish some major Java Enterprise work, so they went with the highest of the highly paid consultants they could find. These consultants came from a big name firm, and were billed at an eye-watering hourly rate.

Elizabeth warns us that the Java code is a behemoth of WTFs that is "too difficult to describe", but one particular WTF leapt out at him. Specifically, included in the application was a file called nonIEUser.html. This project was happening circa 2012, which is after Microsoft finally admitted standards might need to be a thing, and definitely well outside of the time when your web application should only work in Internet Explorer. For a greenfield project, there was no reason to do anything IE only, and fortunately- they didn't. Aside from forcing a check to yell at you if you didn't use IE.

This is the error page that it would display:

<!-- View-Page for errors --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <head> <title>Technical error</title> <meta http-equiv="expires" content="0"> <meta http-equiv="Cache-Control" CONTENT="no-store,no-cache,must-revalidate,post-check=0,pre-check=0"> <meta http-equiv="Pragma" CONTENT="no-cache"> <!--<META name="GENERATOR" content="IBM WebSphere Studio">--> <link rel="STYLESHEET" type="text/css" href="../css/initech.css"> </head> <body> <html lang="en"> <!-- 100 lines omitted --> <p><strong><h2>This application can only be used with Internet Explorer!</h2></strong></p> <p>&nbsp;</p> <p><strong><h2>Other browsers are not supported.</h2></strong></p> <!-- 100 lines omitted --> </html> </body>

The "fun" part of this is that the page isn't wrapped in an <html> tag, and instead the tag is embedded inside the <body>. In the omitted sections is a pile of JavaScript that didn't work in any browser, IE included.

The real killer, though, is that the consultants billed 32 hours on "enforcing IE only compatibility". As it usually goes with consultant-driven projects, nobody in Elizabeth's management blinked twice at paying through the nose for a feature they didn't need, implemented badly.

[Advertisement] ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more.

This post originally appeared on The Daily WTF.

Leave a Reply

Your email address will not be published.