Re: Private variables question
- From: "Phill Harvey-Smith" <phill@xxxxxxxxxxxxxxxxx>
- Date: 30 Apr 2008 08:20:08 -0700
yannis <none@xxxxxxxxxx> wrote in news:mn.f3f17d848d8a3df8.0@xxxxxxxxxx:
Phill Harvey-Smith laid this down on his screen :
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' ? I have been
tending to use 'Pr' in my own code for Private, I guess the compiler
does not care, just wondered why it seemed to be a convention ?
As every body said it is F from Field.
Indeed, that makes much more sense now :)
Me on the other hand I couldn't care less what the prefix is (finally)
I just use the auto complete feature of the IDE which auto prefix the
private members with F and it doesn't give me an option which I can
change it. So it is easier to type
property Count : integer; CTRL+SHIFT+C
and let the IDE create the private variable for me along with the
setter method and let it at that.
Well I never so you can, I must try and remember that, it always amazes me
that I have been using Delphi 7 since it was released and there is still
stuff I don't know about it...neat trick indeed.
Cheers.
Phill.
.
- References:
- Private variables question
- From: Phill Harvey-Smith
- Re: Private variables question
- From: yannis
- Private variables question
- Prev by Date: Re: in-house development versus packaged solutions
- Next by Date: Re: Working With WPF in D2007/D2008?
- Previous by thread: Re: Private variables question
- Next by thread: Re: Private variables question
- Index(es):
Relevant Pages
|