News for hackers. Stuff that matters.
Re:Read this post ‘unless’ you’re not a Ruby developer by jmuguy on Tuesday December 13, 2022 @09:27AM (#33969301)
We use it exclusively for guard statements at the beginning of a function, and we keep it to a single statement per line

return unless token.present? return unless user.valid? return unless foo = get_foo(user)

Its extremely readable and easy to grok imo.

There are no comments on this comment yet.