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

Colorado Train Museum in Golden, Colorado

Located in Golden, just west of Denver, Colorado USA, the museum has an operating track offering train rides, a working roundhouse and turntable,...

Postcards & Emails – PostSecret

—–Email—–—–Frank@PostSecret.com—– Dear Frank, Last week you were speaking in Portland, Oregon.  I walked in a little late to a very crowded room. You said a few...

‘It makes you feel glam’: shaggy, Studio 54-style coats are partying again | Fashion

The New York nightclub Studio 54 closed its doors almost 40 years ago, but it continues to influence how we dress.This time around it...

25 Nordstrom Gifts On Sale

Nordstrom is home to the best fashion, beauty, and homeware gifts. It’s also specifically a treasure trove for gifts on sale, so you can...

5 Years After Launch, the Xbox Series X Is an Afterthought. So What’s Next?

Five years ago today, the Xbox Series X sought to reimagine what...