Today's Delphi Tip of the Day is all about consistent naming conventions. Consistency in the Delphi and Object Pascal language makes it easier to read and comprehend the code.
I have often wondered why the "A" prefix is used on Delphi parameters. Instead of just accepting it a some esoteric thing I googled around and found an answer. Have a look at the following code snippet:
constructor TPerson.Create(AFirstName, ALastName: string);
begin
FirstName := AFirstName;
LastName := ALastName;
end;The "A" in "AFirstName" and "ALastName" denotes an Argument as in the above constructor code example.
Typical naming conventions that are used are:
A := Argument
F := Field
T := Type
E :=
Exception
I := Interface
L := Local Variables
G := Global VariableThe key is to be consistent in all your code. If we as a Delphi community are consistent then it makes it much easier to communicate with each other.
#delphi #tipoftheday #capecodgunny
Enjoy,
Gunny Mike
https://zilchworks.com
Weiterlesen...