Not really Hungarian. This is how I prefix variables, Database Table columns and how I abbreviate common words in my apps (this is an Abr).
- prefixes are application oriented. No language specific datatypes (int32, word etc)
- prefixes are the same cross language. Each programming language used in a project should have the same name for the same variable (eg SQL, C#, Javascript)
| prefix | Data Type | Example | Usage | Comments |
|---|---|---|---|---|
| n | numeric | nPerAge | Person's age | Integer values. Can be negative. |
| s | string | sPerLNm | Person's Last Name | |
| c | currency | cPerSalary | Person's Salary | |
| r | real number | rPerWeight | Person's Weight | used to be “f” but I needed f for functions. |
| d | date | dPerDob | Person's DateOfBirth | |
| t | time | tMetStart | Meeting's Start Time | |
| o | object | oPerson | Person oPerson=new Person(); (C#) var oPerson=new Person(); (C#) | |
| f | function | fCallBack | var fCallback=function(){}; | |
| e | enumeration (string) | ePerMaritalStatus | Person's Marital Status | can have one of prespecified values: see en |
| en | enumeration list | enMaritalStatus | The structure containing the enumeration values | var enMaritalStatus=[SINGLE,MARRIED,SEPARATED,DIVORCED] |
| p | Percentage | pVat | Value added Tax (percentage) | pVat = 0.21; (=21%). Some people think p should be reserved for pointers. I think it is reasonable if there is a possibility to use pointers. |
| b | Boolean | bPerLicensed | bPerLicensed = true; (C#,
Javascript) bPerLicensed = 1; (SQL) | |
| nk | primary key | nkPer | ||
| nf | foreign key | nfPerOrg | Person's organization | |
| rv | rowversion | rvPer | multi user updates | |
| Array | Values | var Values=[]; | Just use the plural form of a noun. | |
| prefix | Data Type | Example | Usage | Comments |
|---|---|---|---|---|
| frm | Form | frmPerEdt | Person Edit form | |
| chk | checkbox | chkbPerActive | Person's active flag | |
| cbo | combo | cboeMaritalStatus | ||
| btn | button | btnDone | ||
| fra | frame-fieldset | fraAdr | Group fields for Person's address | |
| opt | opt | opteMaritalMarried | Marital Status implemented with option button instead of combo | |
| txt | textbox | txtsPerLNm | Person's Last Name | |
| tmr | timer | |||
| dlg | dialog | dlgConfirm | Modal Dialog | |
| lbl | label | lblsPerLNm | "Last Name" | |
| rpt | report | rptDailyOrders | ||
| img | image | imgLogo | ||
| Full Text | Abbreviation |
|---|---|
| Address | Adr |
| Agent | Agn |
| Amount | Amn |
| Category | Cat |
| City | Cty |
| Customer | Cus |
| Date Of Birth | Dob |
| Father | Fth |
| FirstName | FNm |
| Last Name | LNm |
| Issue | Iss |
| Major | Mjr |
| Minor | Mnr |
| Mother | Mth |
| Name | Nm |
| Organization | Org |
| Person | Per |
| Product | Prd |
| Project | Prj |
| Transaction | Trn |
No comments:
Post a Comment