Sometimes, yes. But generally, I don't agree. Omitting the else statement can be confusing to readers, especially if the if block has a fair amount of code (including other branches with return statements). I usually include the else statement for readability, except in trivial cases such as your example.
Like anything it all depends. There are cases when it is useful and others where it is not. In a simple case like this, I think it reduces visual debt. But it's all up to the individual developer.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sometimes, yes. But generally, I don't agree. Omitting the else statement can be confusing to readers, especially if the if block has a fair amount of code (including other branches with return statements). I usually include the else statement for readability, except in trivial cases such as your example.
Like anything it all depends. There are cases when it is useful and others where it is not. In a simple case like this, I think it reduces visual debt. But it's all up to the individual developer.