Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
>>>>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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only