软件开发中的常用缩写

在开发过程中经常会为了减少类、变量、方法等名称的长度而使用缩写。

这些缩写其实是有规范的,比如:Address 通常缩写成 addr,不合理的缩写方式无法让读者通过缩写明白其含义,有时还会显得业余。

《编码命名规范》定义了一些缩写规范,现罗列到下面表格中:

全称 缩写 全称 缩写
Address addr Logical log
Administrator adm List lst
Application app Maximum max
Argument arg Memory mem
Assemble asm Manage / Manager mgr / man
Asynchronization asyn Middle mid
Average avg Minimum min
Database db Message msg
Back bk Multiply mul
Bitmap bmp Number num
Button btn Object obj
Buffer buf Offset ofs
Calculate calc Origin / Original org
Character char Parameter param
Change chg Picture pic
Click clk Package pkg
Color clr Point pnt / pt
Command cmd Position pos
Compare cmp Previous pre / prev
Column col Program prg
Coordinates coord Print prn
Copy cpy Process / Procedure proc
Control ctl / ctrl Properties prop
Current cur Password psw
Cylinder cyl Pointer ptr
Debug dbg Public pub
Double dbl Rect rc
Decrease dec Reference ref
Default def Register reg
Delete del Request req
Destination dest / dst Resource res
Device dev Return ret
Dictionary dict Region rgn
Different diff Screen scr
Directory dir Second sec
Display disp Segment seg
Divide div Select sel
Dialog dlg Source src
Document doc Standard std
Driver drv Storage stg
Dynamic dyna Stream stm
Environment env String str
Error err Subtract sub
Extend ex/ext Summation sum
Execute exec Server svr
Flag flg Synchronization sync
Frame frm System sys
Function func / fn Table tbl
Group grp Temporary temp / tmp
Horizontal horz Translate/Transation/Transparent tran / trans
Index idx / ndx Test tst
Image img Text txt
Implement impl Unknown unk
Increase inc Update upd
Information info Upgrade upg
Initial/Initialize/Initialization init Utility util
Insert ins Variable var
Instance inst Version ver
Interrupt intr Vertical vert
Length len Virus vir
Library lib Window wnd
Link lnk