Elixir Blog Posts

Ya, to each their own always, I just hate ending up with a massive bag of one liner helper functions. And of course small single-use private functions are always a thing, but I think that has been discussed enough on this forum. But I always have to mention the following single use private function (in a very small file) in a Ruby project I worked on years ago:

def raise_unless_user_valid
  raise unless user.valid?
end

sigh

3 Likes