31

By looking at our source code, I see what makes a bad programmer. I see "invalid data" in error logs, guess which of the following 3 conditions caused this:

function somefunc() {
if(condition_1) {
throw "invalid data"
}

if(condition_2) {
throw "invalid data"
}

if(condition_3) {
throw "invalid data"
}

return some_response;
}

Comments
  • 8
    Yup, this has caused me a ton of headaches

    Also,
    newUsr.welcome();
  • 13
    Its better than

    try {
    Do stuff that throws an error ...
    } catch (Exception) {
    }

    Yes thats an empty catch that just silently throws away the error message.

    Have changed over a hundred of such black holes into code that at least logs the error.

    Thankfully the perpetrator is now gone from the company.
  • 0
    @Voxera How did you get rid of the perpetrator (asking for a friend 🤓)
  • 1
    @spky He quit, not my doing.
Add Comment