title: What does __FILE__ == $PROGRAM_NAME mean in ruby?
body: <p>I have stumbled across this sintax while reviewing a code in Ruby. The code is:</p>
  
  <pre><code>if __FILE__ == $PROGRAM_NAME
    #some code...
  end
  </code></pre>
  
  <p>I suppose <code>__FILE__</code> is a variable that gets me the name of the file I am in?
  But what does <code>$PROGRAM_NAME</code> simbolize then? Also, why is this if statement necessary, since the program works with or without it?</p>