|
|
|
|
|
by choward
2112 days ago
|
|
I don't find that more readable at all. I prefer: if deleteUser
user.delete()
end
It's easier for me to read. It doesn't try to hide away logic. And if the line gets longer if the conditional gets more complex or I want to add an else I can without reformatting. |
|
return if a.nil? return if attempts < max_attempts
In this case "return if" becomes like a keyword and you can ignore it and focus on the rest of the expression. It also seems very readable for other simple values like `return false if ...`. But I agree, as soon as the code to the left of the `if` gets non-trivial it is harder to read.