DEV Community

Discussion on: Code Tip: Avoid unnecessary else statements

georgehanson profile image
George Hanson Author

It is not always the case, that is correct. But there are a number of cases where this issue can prop up and it can lead to more readability. Personally I prefer that if code doesn't need to be there then it shouldn't be there. It often allows you to read what the code is doing at a quicker pace.

In this specific example, the "if" is actually an exceptional path. Considering the context of Mononymous people.