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

Our 25 favourite European travel discoveries of 2025 | Travel

A train ride to Titanic’s last stop in County Cork, IrelandOn a midsummer trip to Ireland, I saw dolphins in the Irish Sea, sunset...

2026 customer service planning series: Vol. 04

Real-world example Anthropic ran a focused “Fin hackathon” sprint to improve their AI Agent’s resolution rate. The team audited unresolved queries, identified underperforming topics, and...

‘She asked me if I would pick her daughter up every Friday and babysit until 8 p.m.’: Mom shuts down ex-husband and his mistress...

According to the account, the two women do not have a relationship beyond necessary interactions at shared events for the children. The mom noted...

28 Unique Fashion Gifts For Your Impossibly Stylish Friend

This holiday season, we’ve found the gifts that feel great to get and even better to give. Shop our collection of editor-approved holiday gift...

Necior/awesome-jj: A curated list of awesome Jujutsu things

Jujutsu (also known as jj) is a Git-compatible version control system. This repo contains a curated list of awesome articles, tutorials, videos, tools or other resources that...