变量命名缩写参考

Posted 东皇※太一

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了变量命名缩写参考相关的知识,希望对你有一定的参考价值。

有时候一个变量命名要想上半天,怎么命名合适,怎么才不显得别扭,怎么才显得更舒适,下面提供一些参考,如果某个变量意义一个单词无法表达,可以用多个单词缩写然后用下划线间隔表达,譬如:文件地址:file_addr

A
addr = address
app = application
arg = argument
asm = assemble
asyn = asynchronization
auth = authorization / authentication
avg = average

B
buf = buffer

btn = button

C
calc = calculate
cert = certificate
cmd = command
cmp = compare
col = column
coord = coordinates
cur = current

D
db = database
dec = decrease
del = delete
dst = destination
dev = device
dict = dictionary
diff = different
dir = directory
disp = display
dlg = dialog
doc = document
drv = driver

E
env = environment
err = error
esc = escape
ext = extension
exec = execute

F
frm = frame
func = function

G
grp = group

grd = ground

H
horz = horizontal

I
idx = index
img = image
inc = increase
info = information
init = initialization
ins = insert
inst = instance
intr = interrupt

L
lang = language
len = length
lib = library
lst = list

M
max = maximum
mem = memory
mid = middle
min = minimum
msg = message
mul = multiply

N
num = number

O
obj = object
ofs = offset
org = origin

P
param = parameter
pic = picture
pkg = package
pos = position
prev = previous
prg = program
proc = process / procedure
prop = properties
psw = password
ptr = pointer
pub = public

R
ref = reference
reg = register
req = request
resp = response
res = result
ret = return
rgn = region
rsrc = resource

S
scr = screen
sec = second
seg = segment
sel = select
src = source
std = standard
stm = stream
str = string
sub = subtract
sum = summation
svr = server
sync = synchronization
sys = system

T
tmp / temp = temporary
tran / trans = translate/transation/transparent
txt = text

U
upd = update
upg = upgrade
util = utility

V
var = variable
ver = version
vert = vertical

W
wnd = window

以上是关于变量命名缩写参考的主要内容,如果未能解决你的问题,请参考以下文章

变量命名缩写参考

变量命名与注释

Python命名规则与注释风格

编程的命名法

三种编程命名规范(匈牙利命名法驼峰式命名法帕斯卡命名法)

(转) 三种编程命名规范(匈牙利命名法驼峰式命名法帕斯卡命名法)