What would this return?

you are factually incorrect about the return value

I see me being ESL cause yet another misunderstanding. The function will only ever return 1 type, which is a string, but it still has multiple possible return types.

Any suggestions on how I should've formulated it better?

your proposed solution is nonsensical

That's good, because I never proposed any solutions. All I did was point out bad coding practices.

  • Don't start names with "is", "has", "can", etc. unless it returns a bool.
  • Don't return multiple different types of data (in this case, the other return is implicit).
  • Don't make your code unnecessarily long.

If I had to propose a solution, it would be:

const RESPONSE_TEXT = "big";

The best answer to the question you were responding to is still "The variable, and the conditional check on the variable, do nothing here and should be eliminated."

That is not the answer to the question. It is the solution to the code being bad.

They wanted to know what was wrong with the code, I made a list of things that are wrong with the code.

And that is all I ever did. What solution do you think I was proposing exactly?

/r/ProgrammerHumor Thread Parent Link - i.redd.it