title: Classes in VBScript: Why do these two examples do the same thing?
body: <p>I found this piece of code on this StackOverFlow question, <a href="https://stackoverflow.com/questions/13543942/dictionary-of-objects-classes-in-vbscript">Dictionary of Objects/Classes in VBScript</a>.</p>
  
  <p>My question is why does this "short" class do the same thing as this "long" class? Why even bother coding the long class? Could the short class version be used with additional methods within the same class? Thanks!</p>
  
  <p>Short class</p>
  
  <pre><code>Class employeeclass
      Public first, last, salary
  End Class
  </code></pre>
  
  <p>Long Class</p>
  
  <pre><code>Class employeeclass
      Private m_first
      Private m_last
      Private m_salary
  
      Public Property Get first
          first = m_first
      End Property
      Public Property Let first(value)
          m_first = value
      End Property
  
      Public Property Get last
          last = m_last
      End Property
      Public Property Let last(value)
          m_last = value
      End Property
  
      Public Property Get salary
          salary = m_salary
      End Property
      Public Property Let salary(value)
          m_salary = value
      End Property
  End Class
  </code></pre>
  
  <p>Full script with the short class however, just replace the short class with the long class an get the same result.</p>
  
  <pre><code>Class employeeclass
      Public first, last, salary
  End Class
  
  Dim employeedict: Set employeedict = CreateObject("Scripting.Dictionary")
  
  Dim employee: Set employee = new employeeclass
  With employee
      .first = "John"
      .last = "Doe"
      .salary = 50000
  End With
  employeedict.Add "1", employee
  
  Set employee = new employeeclass
  With employee
      .first = "Mary"
      .last = "Jane"
      .salary = 50000
  End With
  employeedict.Add "3", employee
  
  Dim employeedetails: Set employeedetails = employeedict.Item("1")
  WScript.Echo "Name: " &amp; employeedetails.first &amp; " " &amp; employeedetails.last &amp; " $" &amp; employeedetails.salary 
  WScript.Echo employeedict.Item("3").first &amp; " " &amp; employeedict.Item("3").last &amp; " makes $" &amp; employeedict.Item("3").salary
  </code></pre>