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

What NASA Is Looking For In Yellowstone National Park

This is a transcript of an episode of Untold Earth, a series from Atlas Obscura in partnership with Nature and PBS Digital Studios, which...

Adira’s Story – PostSecret

Dear Frank,  I write to you with incredible news. Last month, I brought home my new service...

Is it weird facelifts are becoming normalized, or am I being too judgmental? | Well actually

Dear Ugly,I’m 36 and I don’t need or want a facelift – but lately I feel like I’m being made to want a facelift....

15 Winter Hair Color Trends Predicted By Experts 2025

In his recent cold-weather trend report, hair artist Tom Smith predicted that muted mid — essentially “soft, neutral-warm shades that sit between blonde, brunette,...

Oura Is Suing These Smart Ring Makers

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