What is the result of the Fxxx private class name prefix agreement?

In C ++ / C #, the general convention for private classes is vars m_MyPrivateVar , and I believe that m_ "means" mine "(maybe I'm wrong).

In Delphi, private class variables start with F , for example. Fhandle etc.

What does F mean? Foo? :)

+7
source share
1 answer

There are several naming conventions that cannot be lost in code.

Here is an example to indicate why this is useful.

 // Types begins with T TFoo = class strict private // sometimes I saw strict private fields beginning with underscore // I like this too _Value : string; private // private class vars are Fields and therefore begins with F FValue : string; function GetValue : string; public property Value : string read GetValue write FValue; // Parameters should NOT begin with P (P is for Pointer) but with A // because "i will pass A value" :o) function GetSomething( const AValue : string ) : string; end; function TFoo.GetValue : string; begin Result := '*' + FValue + '*'; end; function TFoo.GetSomething( const AValue : string ) : string; var // IMHO there is no naming convention to Local vars // but mine begins with L LValue : string; begin LValue { local var } := Value { property via getter } + AValue { parameter } + FValue { field }; Result := LValue; end; 
+17
source

All Articles