Thoughts

mental health break ,./'"**^^$_---
The problem with "unless" in Ruby is that a lot of the time when you have a falsey condition, it's a condition that you expect to be true.
"unless" in English carries the connotation that the thing is normally not true. So if you're doing form validation, I might do: ```rb if !form.is_valid? return :400 end ``` But, that's annoying, because "if not form is valid" isn't how you speak English. And the condition is already inverted, so it seems like a good candidate for an "unless". ``` unless form.is_valid? return :400 end ``` "unless form is valid" is grammatically correct, but this has actually decreased readability because "error unless the form is valid" is the exact opposite of how you think about this control flow. It makes it sound like erroring is the default and this behavior is avoided in the special case that the form is valid. Lots of ways to fix this; I think I would prefer `if form.is_invalid?; return :400; end`
Link 8:41 p.m. Dec 20, 2023 UTC-6