Yes. A public variable can be changed by any procedure or method, making it difficult to debug. A property is encapsulated inside a class and the class can control who can access the properties and who can change it. You can even hide it completly and make the user access it's value by methods only.
I don't use PUBLIC variables anymore since VFP 3.0. I don't use many PRIVATE variables either. Eevrything is either LOCAL or a class property.
>So do you mean to say that it is better to have an object with 100 properties instantiated rather than having 100 public/global variables in the main program?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement