Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
>>>>PUBLIC oldproduct, oldrinward, sale2edit, sale2add, zuretval, oareacode, oareaname, osmancode, osmanname, oaccode, oacname, ocompcode
>>>Dont use Public!
>>>And if you cannot avoid
>>>than dont use them
>>There is NOTHING wrong with using PUBLIC, Koen. There are probably better ways to code than using
>>PUBLIC, but it is perfectly legal and will work correctly, and in some cases is the only way to accomplish
>>something.
>
>There is little BENEFIT to PUBLIC. By avoiding it, programmers will learn the better ways to code.
Such a comment conveys a lot of assumptions. It also negates the fact that there are dozens of scenarios where PUBLIC is not only desirable, but the most efficient solution. There are always other ways to code things, but sometimes simpler is better. Each component has its place, and learning the conditions surrounding when to use each is what makes a programmer learn better ways to code.
FWIW, Visual FreePro adds the concept of "thread globals" which are public definitions visible only to the current thread, called TPUBLIC or TGLOBAL.
The right tool for the right job. Right? Sometimes PUBLIC is most desirable, and my response to Koen was to his comment "don't use public," which I do not believe is good advice as it immediately shuts people off to the idea of ever using a PUBLIC definition, when using PUBLIC definitely has its place.
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