title: What is the difference of immutable and mutable variables?
body: <p>I have read almost every definition of immutable/mutable variables on the internet but as a beginner I just do not grasp it fully so I was wondering if someone could really explain it in layman terms.</p>
  
  <p>Immutable variables (or objects) in any programming language is what I understand when you cannot change the value of that variable after it has been assigned a value. For example, I am using the Haskell programming language, and I write:</p>
  
  <pre><code>let x = 5
  </code></pre>
  
  <p>Since Haskell has immutable variables, x can never have any other value than 5. So if I after that line of code write:</p>
  
  <pre><code>x = 2
  </code></pre>
  
  <p>I have in fact not changed the value of x but made a new variable with the same name, which will now be the one that is referenced when I call x, so after both lines of code I can only reach an x with the value of 2.</p>
  
  <p>But what is a mutable variable then, and what programming languages have it? This is where it gets foggy for me. Because when people say mutable variable, they are obviously referring to a variable or object which value you <em>can</em> indeed change after it has been assigned an initial value. </p>
  
  <p>Does this mean that if you have a mutable variable you actually manipulate <em>that place in the computers memory</em> for that variable, and in case of immutable variable you cannot manipulate that place in the computers memory or what?</p>
  
  <p>I don't know how to explain my question any further, as I said, I understand that mutable = can change value of variable after initial value assignment, immutable = cannot. I get the definition. But I don't understand what it actually means in terms of what is going on "behind the scenes". I guess I am looking for easy examples on actual mutable variables.</p>