DEV Community

Discussion on: What's the Worst Code You've Ever Seen or Written?

Collapse
 
circuitburn profile image
Patrick Ryan • Edited

I wrote this gem yesterday:

if (!$doNotSendActivationEmail)
{
    //...
}

The client does most of the front-end development and the whole logic for this was implemented ass-backwards; the checkbox's checked state disabled an email from being send. I chose to run with that logic on the back-end so we would be less likely to mix up the intention of the checkbox.