Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a distinct name for prefix notation used in Delphi oftenly? [duplicate]

Possible Duplicate:
Does my variable naming convention have a name?

Notation in question is described by example below:

  • T for type
  • P for pointer
  • F for field
  • A for argument
  • L for local

et cetera, there is at least S missing from the list, but i'm not sure which string it designates.

First 3 prefices was with Delphi since very beginning, last 2 i've noticed relatively recently. I'd like to know notation name (if any), and read some normative whitepaper (and adopt then, may be).

like image 753
Premature Optimization Avatar asked Jun 13 '11 03:06

Premature Optimization


People also ask

What does m_ prefix mean?

As stated in many other responses, m_ is a prefix that denotes member variables. It is/was commonly used in the C++ world and propagated to other languages too, including Java. In a modern IDE it is completely redundant as the syntax highlighting makes it evident which variables are local and which ones are members.

What is prefix variable?

The idea of variable prefixesThey are used to tell the developer what kind of variable he is using. The first prefix for example is m_ and the conclusion is this variable is a member. When I learned programming we had to give the developer more information in case of a member.

Is prefix should be used for variables and methods?

is prefix should be used for boolean variables and methods. This is the naming convention for boolean methods and variables used by Sun for the Java core packages. Using the is prefix solves a common problem of choosing bad boolean names like status or flag.


1 Answers

Zarko Gajic has a pretty good Delphi-specific list here: http://delphi.about.com/od/standards/l/bldnc.htm

Personally, I find some conventions like this useful. I still remember my first language FORTRAN, where the convention for Integers was to start them any letter from I to N, and it was easy to remember because they are the first two letters of INteger.

Section "3.3 Field Naming" of the Object Pascal Style Guide by Charles Calvert gives a brief but good guide as to when to use Hungarian notation, and also what single character identifier names are appropriate. My FORTRAN background (8 character names max) also made me use "N" as the count of items and led to code such as:

   DO 10 I = 1, N
     DO 20 J = I, N
       ...
20   CONTINUE
10 CONTINUE

Ouch! The memories hurt.

like image 60
lkessler Avatar answered Sep 29 '22 22:09

lkessler