title: Why is "slurping" a file not a good practice?
body: <p>Why is "slurping" a file not a good practice for normal text-file I/O, and when is it useful?</p>
  
  <p>For example, why shouldn't I use these?</p>
  
  <pre><code>File.read('/path/to/text.txt').lines.each do |line|
    # do something with a line
  end
  </code></pre>
  
  <p>or</p>
  
  <pre><code>File.readlines('/path/to/text.txt').each do |line|
    # do something with a line
  end
  </code></pre>