Hacker News new | ask | show | jobs
by vbezhenar 3886 days ago
I'm not always own code. Simple example:

    getCharsetOpt("UTF-8")
There is no way this code will return None in this particular case. So any additional checks are unnecessary and make code less readable.
1 comments

I don't know who said it, and this is probably a paraphrase:

"If it can't happen, it will".

If a function says the result is optional, then it's optional. It's not not optional because you decided it can't ever fail.