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

How Y Combinator Started

March 2012Y Combinator's 7th birthday was March 11. As usual we were so busy we didn't notice till a few days after. ...

Saturday Morning Breakfast Cereal – Protagonist

Click here to go see the bonus panel!Hovertext:I really regret all that stuff I did to the antagonist now.Today's News: Pre-orders for my new book Sawyer...

Chanel Lip Haul: 31 Le Rouge, Le Rouge Duo Ultra Tenue + Rouge Coco Flash

I hauled a few lip products from Chanel recently and I am thrilled with the things I picked up! They re-released a few shades...

666: We Have Nothing That Hot

🗣️ New ATP Member’s Special: ATP Diamond Dogs: Talk Me Out of It II ATP Diamond Dogs: Talk Me Out of It — 16 October...

Trump Calls for Jimmy Kimmel to Be Fired AGAIN, Threatens Members of Congress & Signs Epstein Bill | Jimmy Kimmel Live

Jimmy woke up this morning to Donald Trump once again posting that Jimmy should be fired again,...