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

2026 customer service planning series: Vol. 03

AI doesn’t fail because the model is bad, it fails because ownership is missing. Once someone owns it, everything changes. Your resolution and automation rates...

Hot Ones – Penny Arcade

Amazon Black Friday and Cyber Monday Fashion Deals

Jessica C. Andrews (she/her) is an award-winning editor and writer who currently works as the senior style director of PS, overseeing beauty, fashion, shopping,...

668: So Happy for All Parties Involved

Pre-show: Marco has a new toy Follow-up: Vision Pro Light Seal sizes decoded Vision Pro Size Help tool JPEG XL lives… in PDF Chromium ticket jxl-rs: JPEG XL in Rust Chapter...