Delphi Tip of the Day – What is the "A" prefix I see used on parameters?
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 as some esoteric thing as I have done for the past twenty years, I googled around and found an answer. Have a look at the following code snippet:
Typical naming conventions that are used are:
See also:
Object Pascal Style Guide By: Charles Calvert
[Archive]
#delphi #tipoftheday #capecodgunny
Enjoy,
Gunny Mike
https://zilchworks.com
I have often wondered why the "A" prefix is used on Delphi parameters. Instead of just accepting it as some esoteric thing as I have done for the past twenty years, I googled around and found an answer. Have a look at the following code snippet:
constructor TPerson.Create(AFirstName, ALastName: string);The "A" in "AFirstName" and "ALastName" denotes an Argument as in the above constructor code example.
begin
FirstName := AFirstName;
LastName := ALastName;
end;
Typical naming conventions that are used are:
A := ArgumentThe 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.
F := Field
T := Type
E := Exception
I := Interface
L := Local Variable
G := Global Variable
See also:
Object Pascal Style Guide By: Charles Calvert
[Archive]
#delphi #tipoftheday #capecodgunny
Enjoy,
Gunny Mike
https://zilchworks.com