Re: Private variables question
- From: "Rudy Velthuis [TeamB]" <newsgroups@xxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 18:55:21 +0200
Phill Harvey-Smith wrote:
Hi,
This is more from a mater of interest than any technical reason, but
there seems to be a lot of code around where the private variables
are called FSomething e.g.
TYPE TSomeType=class(object)
PRIVATE
FLocalVar : INTEGER;
PUBLIC
PROPERTY LocalVar : INTEGER READ FLocalVar;
END;
What I guess i'm asking is why prefix it with 'F'
F stands for Field, which is Pascal/Delphi parlance for a data member
of a class or record. The T in TSomeType stands for Type.
I guess F was originally used to distinguish the backing data member
from the property. I.e. a property with the name Status would often
have a backing data member with the name FStatus. I also guess that
this was convenient to recognize private members, so later on, the
principle of naming private fields starting with an F was used for all
private fields.
--
Rudy Velthuis [TeamB] http://www.teamb.com
"We totally deny the allegations, and we are trying to identify
the allegators."
.
- References:
- Private variables question
- From: Phill Harvey-Smith
- Private variables question
- Prev by Date: Re: in-house development versus packaged solutions
- Next by Date: Re: in-house development versus packaged solutions
- Previous by thread: Re: Private variables question
- Next by thread: Re: Private variables question
- Index(es):
Relevant Pages
|