DEV Community

Discussion on: Do you leave jokes in your code? If so, please share!

Collapse
 
itachiuchiha profile image
Itachi Uchiha • Edited

Our software which we use in the office, I leave a code like this:

const err = {
    count: 0
}

const btn = document.querySelector(".js-btn-remove")

btn.addEventListener("click", () => {
    if(err.count == 5) {
                // omg, you can't be serious. you're still trying...
        myFancyMessage({
                   title: 'Leave me alone...',
                   text: [
                      'unhappy',
                      `Don't do this again. You almost kill me. This hurts me.`,
                   ]
                })
        return false;
    }

         myFancyMessage('Warning', 'You are not authorized to remove sales.')        

    // some important codes
    err.count++

})
Enter fullscreen mode Exit fullscreen mode
Collapse
 
keinchy profile image
Frederick Jaime

err.count == 5? how did you come up with this number?

Collapse
 
itachiuchiha profile image
Itachi Uchiha

5 is my favorite number. :P

No, it just an example. I just exemplified the scenario.

Collapse
 
mercier_remi profile image
Rémi Mercier

This is precious! 😄