Apart from an architectural point of view, i'm wondering if there is any difference in .net between a readonly property and a function. Are properties only conceptual wrappers around functions?
Private m_Property As String
Public ReadOnly Property PropertyGet() As String
Get
Return m_Property
End Get
End Property
Public Function FunctionGet() As String
Return m_Property
End Function
Disassembling IL shows that there's no difference apart from the name, but are there differences at another level? Is the getter just a function in short(!?)hand?
Edit
: wow, i'm really sorry about not being able to mark multiple answers.
The first answer that pointed out the use of properties to serialize was the road to enlightenment since i had completely left this aspect out. Before that, the explanation of property vs function as "is" vs "does" felt arbitrary. Now, i grok it more.
I think the consensus on property being not time consuming stems from the "is"/serializable concept. If my property talks to a database to store the "is" value, it breaks in horrible ways.