Click here to Skip to main content
11,414,670 members (67,978 online)
Click here to Skip to main content

Programming conventions

, 25 Mar 2002
Rate this:
Please Sign up or sign in to vote.
Some programming convention tables for reference

Introduction

This is less of an article, more of a reference sheet to be printed out and stuck to the wall.

Hungarian Notation

"Hungarian notation" was developed by Hungarian Charles Simonyi of Microsoft ™, hence the name. Most programmers seem to stick to a flavour they like or develop a different flavour. This is a starting point for those who wish to use it. Add extra ones in the blank rows as you see fit.

Data Type

Prefix

Example

Boolean

b

bContinue

Int

n

nIndex

Short

n

nIndex

Character

c

cFirstInitial

Float

f

Percent

Double

d

dMetres

Long

l

lCarCount

String

s

sCustomerName

Null terminated String

sz

szCustomerName

Unsigned Integer (Word)

w

wCount

Unsigned long integer (DWORD)

dw

dwAtomCount

Pointer

p

pNext

Handle

h

hWnd

Function

fn

fnReport

Class

C

CParser

Class member variable

m_

m_

Array

a

aYears

Global

g_

g_szDirectory

Windows message

Msg

msgCut

You can add some of the prefixes together where they make sense.

  • For example a member variable which is a null terminated string , "m_szName".
  • Another might be for a global integer eg. "g_nElementCount".

Windows Resources

Resource Type

Prefix

Example

Menu Item Resource

ID_

ID_EDIT_CUT

String

IDS_

IDS_STRING1

Dialog Control

IDC_

IDC_EDITBOX

ICON

IDI_

IDI_MAINICON

Cursor

IDC_CURSOR_

IDC_CURSOR_ARROW

Dialog Box

IDD_

IDD_ABOUTBOX

Accelerator

IDR_

IDR_ACCELERATOR

Bitmap

IDB_

IDC_ARROW

Free free to email me your updates/suggestions and I will update the article as necessary.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

bryce
Software Developer (Senior)
Australia Australia
No Biography provided

Comments and Discussions

 
Questionn is for integer? Pin
Felix Cho8-Apr-02 5:59
memberFelix Cho8-Apr-02 5:59 
GeneralAvoid Hungarian Notation ! Pin
Warren Stevens28-Mar-02 4:11
memberWarren Stevens28-Mar-02 4:11 
GeneralRe: Avoid Hungarian Notation ! Pin
Nish [BusterBoy]28-Mar-02 4:22
memberNish [BusterBoy]28-Mar-02 4:22 
GeneralRe: Avoid Hungarian Notation ! Pin
Warren Stevens28-Mar-02 4:52
memberWarren Stevens28-Mar-02 4:52 
GeneralRe: Avoid Hungarian Notation ! Pin
Kevin McFarlane28-Mar-02 8:55
memberKevin McFarlane28-Mar-02 8:55 
GeneralRe: Avoid Hungarian Notation ! Pin
Jason Gerard28-Mar-02 11:14
memberJason Gerard28-Mar-02 11:14 
GeneralRe: Avoid Hungarian Notation ! Pin
Alvaro Mendez28-Mar-02 13:02
memberAlvaro Mendez28-Mar-02 13:02 
GeneralRe: Avoid Hungarian Notation ! Pin
Rick York30-Mar-02 14:16
memberRick York30-Mar-02 14:16 
GeneralRe: Avoid Hungarian Notation ! Pin
Tim Smith28-Mar-02 6:46
memberTim Smith28-Mar-02 6:46 
GeneralRe: Avoid Hungarian Notation ! Pin
Warren Stevens28-Mar-02 7:49
memberWarren Stevens28-Mar-02 7:49 
GeneralRe: Avoid Hungarian Notation ! Pin
Tim Smith28-Mar-02 6:51
memberTim Smith28-Mar-02 6:51 
GeneralRe: Avoid Hungarian Notation ! Pin
Warren Stevens28-Mar-02 7:51
memberWarren Stevens28-Mar-02 7:51 
GeneralRe: Avoid Hungarian Notation ! Pin
Tim Smith28-Mar-02 9:01
memberTim Smith28-Mar-02 9:01 
GeneralRe: Avoid Hungarian Notation ! Pin
Roger Allen28-Mar-02 7:17
memberRoger Allen28-Mar-02 7:17 
GeneralRe: Avoid Hungarian Notation ! Pin
Warren Stevens28-Mar-02 7:44
memberWarren Stevens28-Mar-02 7:44 
GeneralRe: Avoid Hungarian Notation ! Pin
Jim A. Johnson29-Mar-02 18:53
memberJim A. Johnson29-Mar-02 18:53 
GeneralRe: Avoid Hungarian Notation ! Pin
Warren Stevens1-Apr-02 4:32
memberWarren Stevens1-Apr-02 4:32 
GeneralRe: Avoid Hungarian Notation ! Pin
yarp28-Mar-02 8:39
memberyarp28-Mar-02 8:39 
GeneralRe: Avoid Hungarian Notation ! Pin
Bill Leibold28-Mar-02 12:41
memberBill Leibold28-Mar-02 12:41 
GeneralRe: Avoid Hungarian Notation ! Pin
Jim Meek29-Mar-02 1:35
memberJim Meek29-Mar-02 1:35 
GeneralRe: Avoid Hungarian Notation ! Pin
Christian Graus28-Mar-02 13:05
memberChristian Graus28-Mar-02 13:05 
GeneralRe: Avoid Hungarian Notation ! Pin
Shog929-Mar-02 20:08
memberShog929-Mar-02 20:08 
GeneralRe: Avoid Hungarian Notation ! Pin
Warren Stevens1-Apr-02 5:13
memberWarren Stevens1-Apr-02 5:13 
GeneralRe: Avoid Hungarian Notation ! Pin
Christian Graus1-Apr-02 10:23
memberChristian Graus1-Apr-02 10:23 
GeneralRe: Avoid Hungarian Notation ! Pin
Andy Smith1-Apr-02 11:17
memberAndy Smith1-Apr-02 11:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150427.4 | Last Updated 26 Mar 2002
Article Copyright 2002 by bryce
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid