Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>>So when is a var required to be public?
>>
>>Only when its real scope is over the entire application.
>
>Incorrect, it is only when its requried scope extends beyond the routine that creates it. A private in the startup program is global to the entire application.
Technically, yes. But if I declare a variable as PUBLIC, anyone will understand that I mean it to have public scope. If I declare it PRIVATE, some may wonder if it was intended to be private from a higher level or is just a programming issue.
>I propose that using publics is a bad design in itslef.
I know. :) And I agree with you (for my own applications). But this doesn't mean any other design that uses public variables is bad.
Vlad
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