RE: PUBL VARS PRO&CONTRA
From: Tamar Granor
Pennsylvania - United States
To: Thomas Bähr
PUBl Vars Pro&Contra
RE: PUBl Vars Pro&Contra
Visual FoxPro 9
General VFP Topics
Tuesday, August 14, 2007 11:01:24 PM
This message was rated by:
> > Thomas
> > You are totally missing the point. If you use a Public Variable you CANNOT enforce encapsulation!
> I didnt miss that point.
> I was only against that simple Statment saying:
> PUBl vars are bad Creating an Object and add the PROPs there if you really need "PUBL" Data.
> + that PUBL non-encapsulated and OOP is encapsulated ... which is still not true ....
FWIW, I thought (and wrote) that public variables were a bad idea long before FoxPro had OOP.
Public variables are an invitation to trouble. They are also, usually, a sign of bad design or of ignorance on the part of the programmer. (Ignorance of what depends on the situation, but sometimes it's parameters, sometimes it's custom properties, sometimes something else.)