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

Shek O Bus Terminus in Hong Kong

After the journey through the winding roads of Hong Kong Island's verdant south side, the first sight that greets visitors to the popular beach...

The Music Biopic is a Genre That Will Never Fully Work

How Springsteen Tried to Do Something DifferentThere has been an increasing demand for music biopics following the success of Bohemian Rhapsody in 2018. That...

The Best Outfits From “Love Island USA” Season 7 Reunion

While each product featured is independently selected by our editors, we may include paid promotion. If you buy something through our links, we may...

Clockwise #618: A Polyamorous Situationship

Support this show Enjoy Clockwise Unwound: Ad-free episodes and an extra Overtime topic every week. #618: A Polyamorous Situationship August 13th, 2025 · 29 minutes Our display setup and window...