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

An entire PS5 now costs less than 64GB of DDR5 memory, even after a discount — simple memory kit jumps to $600 due to...

Thanks to the AI boom devouring the majority of the world's memory and storage supply, end-consumers are now facing increasingly inflated prices for common...

AI-Enabled Teddy Bear Pulled From Shelves For Giving Advice On BDSM, Where To Find Knives

Sales of an AI-enabled plush teddy bear were suspended after it was found to have given children explicit sexual content and dangerous guidance, such...

Elsa Hosk Wore the New It Tights-Color-and-Shoe-Trend Combo

As anyone who likes wearing skirts and dresses in the winter will tell you, tights aren't really optional—they're a necessity. Luckily, they make your...

Qure Micro-Infusion System Review With Photos

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

OnePlus Launching 15R Phone, Tablet and Watch Just Ahead of the Holidays

Just ahead of the holidays, Chinese electronics company OnePlus is releasing three new products: a phone, a tablet and a watch. The company announced...