title: Ruby flow control: throw an exception, return nil or let it fail?
body: <p>I am thinking of the best practices of flow control. Which way should I go?</p>
  
  <p>1) Don't check anything and let the program fail (cleaner code, natural error messages):</p>
  
  <pre><code>  def self.fetch(feed_id)
      feed = Feed.find(feed_id)
      feed.fetch
    end
  </code></pre>
  
  <p>2) Fail silently by returning nil (however, "Clean Code" says, that you should never return null):</p>
  
  <pre><code>  def self.fetch(feed_id)
      return unless feed_id
      feed = Feed.find(feed_id)
      return unless feed
      feed.fetch
    end
  </code></pre>
  
  <p>3) Throw exceptions (because it's exceptional not to find a feed by id):</p>
  
  <pre><code>  def self.fetch(feed_id)
      raise ArgumentError.new unless feed_id
      feed = Feed.find(feed_id)
      raise ArgumentError.new unless feed
      feed.fetch
    end
  </code></pre>
  
  <p>To put it in other words: should I be using guard conditions actively, or is it better to rely on Ruby / Rails methods and let them throw an exception, if something wrong happens?</p>