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

The Toll of Stress on Startup Teams and Its Link to Founder Well-being

Startup Snapshot, a think tank uncovering the unspoken realities of the entrepreneurial ecosystem, has released its latest report, The Untold Toll (Part 2): Navigating...

Man Rides Disneyland Attraction 15,000 Times

A Disney superfan celebrated his 15,000th ride on the Cars-themed Radiator Springs Racers at Disney California Adventure, having documented every go-around since 2012. What...

Clockwise #588: Neither, But Sorta

Support this show Enjoy Clockwise Unwound: Ad-free episodes and an extra Overtime topic every week. #588: Neither, But Sorta January 15th, 2025 · 29 minutes Our use of CarPlay, Android...

Ghosts’ Danielle Pinnock Unpacks Alberta’s Big Secret And Real Name

TVLINE | We find out that Alberta used...