The Right Helper – The Daily WTF

Date:

Share:

Greg was fighting with an academic CMS, and discovered that a file called write_helper.js was included on every page. It contained this single function:

function document_write(s)
{
   document.write(s);
}

Now, setting aside the fact that document.write is one of those “you probably shouldn’t use this” functions, and is deprecated, one has to wonder what the point of this function is. Did someone really not like object-oriented style code? Did someone break the “.” on their keyboard and just wanted to not have to copy/paste existing “.”s?

It’s the kind of function you expect to see that someone wrote but that isn’t invoked anywhere, and you’d almost be correct. This function, in a file included on every page, is called once and only once.

More like the wrong helper, if we’re being honest.

Source link

Subscribe to our magazine

━ more like this

Tom Cruise Buys Fitbit To Help Him Get 10,000 Daily Stunts

CLEARWATER, FL—Explaining that his personal health was everything to him, Tom Cruise told reporters Thursday he had purchased a Fitbit to help him get...

Elevate Your Style With These Burst Fade Haircuts For Men

Burst Fade The burst fade is a striking blend of traditional and contemporary styling, creating an eye-catching rounded fade that arches around the ear and...

Chanel Les 4 Ombres Boutons

Chanel Beauty launched new limited-edition eyeshadow palettes called the Les 4 Ombres Boutons Multi-Effect Quadra Eyeshadow ($86 each, Chanel and Nordstrom). They sold out...

Apple Watch Bands Are 70% Off Right Now

We may earn a commission from links on this page. ...

Steam baths and seaweed safaris on Sweden’s spa island | Sweden holidays

If you came to stay on the tiny island of Styrsö (steer-shuh) in the Gothenburg archipelago in the late 19th or early 20th century,...