Functions and ReadOnly Properties

VBobCat

Well-known member
Joined
Sep 6, 2011
Messages
137
Location
S?o Paulo, Brazil
Programming Experience
3-5
This is a theoretical question:
When designing custom classes, how should I choose between implementing a Function or a ReadOnly Property? Is there any practical consequence about this choice? What is the difference between them?
Thank you very much.
 
You should definitely follow the link provided by JohnH but I will say that the first thing to consider is that properties are supposed to represent data while methods are supposed to represent behaviour. If you can determine whether your member represents data or behaviour then you know which it should be. If it falls in a grey area between the two then you have to think a little harder but I would that, if in doubt, use a method.
 
Back
Top