In a User-Defined Class:
For "derived" properties, rather than base properties, is there any difference between coding these as properties or coding them as functions.

e.g. is there any advantage to using the "Area" property versus the "Area2" function in the following? Or visa versa?


VB Code:
  1. Option Explicit
  2.  
  3. Private pLGH As Long
  4. Private pHGT As Long
  5.  
  6. 'base properties - lets and gets
  7. Public Property Let Length(newLength As Long)
  8.     pLGH = newLength
  9. End Property
  10.  
  11. Public Property Let Height(newHeight As Long)
  12.     pHGT = newHeight
  13. End Property
  14.  
  15. Public Property Get Length() As Long
  16.     Length = pLGH
  17. End Property
  18.  
  19. Public Property Get Height() As Long
  20.     Height = pHGT
  21. End Property
  22.  
  23.  
  24. 'derived property - using property
  25. Public Property Get Area() As Long
  26.     Area = pLGH * pHGT
  27. End Property
  28.  
  29. 'derived property - using function
  30. Public Function Area2() As Long
  31.     Area2 = pLGH * pHGT
  32. End Function