Earlier quoted context omitted.
CoffeeScript (which this is forked from) has some parts like this that I strongly dislike, such as using the unless keyword after an action. For example: doSomeThing() unless person.present For me that utterly destroys readability - in my mind, when I see a (), that function is being called there and then. The fact that you can invalidate that later in the line confuses me deeply - and it doesn't really provide any b…
That's not specific to 'unless' – it's the general postcondition style that's is derived from Ruby. Indeed, for single-line if statement bodies in Ruby, it's the recommended style. It fits the style of Ruby to try and cut down on syntax noise where it's not needed. Contrast: save! if !record.persisted? && !record.invalid? save! unless record.persisted? || record.invalid? Though I do appreciate it's a bit unusual comp…
if !record.persisted? && !record.invalid?
save!
or: unless record.persisted? || record.invalid?
save!