title: Is closing the resources always important?
body: <p>Many times I met the statement that the application should always explicitly close all the resources that it opened.</p>
  
  <p>My approach to programming is rather pragmatic and I don't like to blindly follow any convention that I don't clearly see benefits of. Hence my question.</p>
  
  <p>Let's assume that:</p>
  
  <ol>
  <li>I have a small application</li>
  <li>It opens a few resources (e.g. files, database connections, remote streams) and processes it</li>
  <li>It works a few minutes and then it exits</li>
  <li>Let's say it's in Java (if the language is relevant)</li>
  </ol>
  
  <p>Do I really have to care about closing all the resources that I opened? I guess all the resources I opened will be closed/released when the application/virtual machine exits. Am I right?</p>
  
  <p>If that's true, are there any convincing reasons to care about closing resources in such small, short working application?</p>
  
  <p>UPDATE:</p>
  
  <p>The question is purely hypothetical, but the argument for <strong>not caring</strong> about that is that I may be just hacking together some quick script and don't want to write any unnecessary code not directly related to the problem at hand: closing resources, doing all this verbose try-catch-finally stuff, handling exceptions that I don't care about etc. </p>
  
  <p>The point of the question is whether there are any <em>practical</em> consequences of not doing it.</p>