0J)s2&H
m7 =$*1k
GP|=4T}Bf
1、"&"替换"+". R$awg SE
在很多人的编程语言中,用“+”来连接字符串,这样容易导致歧义。良好的习惯是用“&”来连接字符串. IP~!E_e}\
不正确: ^4y]7p
dim sMessage as string =8kmFXo
US6_5>/
sMessage="1"+"2" FqKJids-
;t`
?|
正确: EP;/[O
dim sMessage as string WeI+|V$
|D3u"Y!:^
sMessage="1" & "2" (JhX:1
注意:"&"的后面有个空格. N0U/u'J!g
#Ondhy%h[
2.变量命名大小写,语句错落有秩 )Nv1_en<!
下面大家比较一下以下两段代码: E-MPFL
读懂难度很大的代码: +jN}d=N-
dim SNAME as string !XA3G`}p6s
dim NTURN as integer x%P|T3Qy5
"(koR Q
fn#8=TIDf
if NTURN=0 then }kbSbRH43
if SNAME="sancy" then [\uR3$j#
end if g|=_@
pL
Do while until NTURN=4 73WSW/^F
NTRUN=NTURN+1 H#-3
Loop +>w]T\[1~
End if ]6&NIz`:,
容易读懂的代码: W+nu=iQ!
dim sName as string J3Mb]X)_}
dim nTurn as integer e5=d
Ev
<t%gl5}|
if nTurn=0 then wN2+3LY{
I0=_=aZO(
if sName="sancy" then
gwZ<$6
&4'<