Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Delphi-News aus aller Welt (https://www.delphipraxis.net/58-delphi-news-aus-aller-welt/)
-   -   Delphi Tip of the Day - What is the "A" prefix I see used on parameters? (https://www.delphipraxis.net/199952-delphi-tip-day-what-prefix-i-see-used-parameters.html)

DP News-Robot 5. Mär 2019 01:11

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 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...


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:01 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz