CodeSOD: Paste Parse

Sandra (previously) is still working with Bjørn. Bjørn also continues to like keeping things… simple.

"Simple" for Bjørn is "do as much in PHP as possible since I am okay at PHP, including templating out JavaScript. If I have any third party libraries, just copy and paste them into the project and never, ever use a bundler because WebPack is scary."

Which, in Bjørn's defense, WebPack and tools like it are scary, and I hate them all as a class. But that's a separate rant that's wildly off topic, so let's just get back to Bjørn.

Because Bjørn does JavaScript via PHP templates, copy/paste, and general "massage the code until it works", we end up with this nonsense line not only getting deployed, but staying deployed until someone has the time and budget to do a large scale refactoring of all of the code:

console.log(parseInt('abc'));

The surrounding code has been excluded, as it doesn't matter and offers nothing. This line exists, it doesn't work, and shouldn't be there.

[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!

This post originally appeared on The Daily WTF.

Leave a Reply

Your email address will not be published.