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 to Write Usefully

February 2020What should an essay be? Many people would say persuasive. That's what a lot of us were taught essays should be. But I think...

Study Finds Weed Use Linked To Early Heart Disease

A study found that healthy people who regularly smoked marijuana or consumed THC-laced edibles showed signs of early cardiovascular disease similar to tobacco smokers....

23 Best Travel Pants For Women 2025

When curating our list of the best travel pants, we held them to sky-high standards: They needed to be versatile enough to wear straight...

Courteney Cox’s Must-Have Products: Shop Her Beauty Picks

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