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 Four Quadrants of Conformism

July 2020One of the most revealing ways to classify people is by the degree and aggressiveness of their conformism. Imagine a Cartesian coordinate system whose horizontal...

Dark Matter – PostSecret

For twenty years, PostSecret has broadcast suburban America’s hidden truths—and revealed the limits of limitless disclosure. — Meg Bernhard In the early aughts, Frank Warren ran...

Megan Fox’s Pink Cherub Nails Are a Nod to Her New Baby

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

638: Hop, Hop, Hop

Pre-show: Chromebook-block evasions Follow-up: At least one person did miss our WWDC sale. 🙁 Vision Pro Corner: StagePlay Blue Man Group Epic vs. Apple The Verge on Apple’s decision making Apple’s...

Colin from Accounts stars confirm season 3 will begin with a time jump

However, speaking to RadioTimes.com on the red carpet for the 2025 BAFTA Television Awards with P&O Cruises,...