procedure MyProc(Eval: Boolean); begin if not Eval then Exit; /* do stuff */ /* do more stuff */ end;
要么
procedure MyProc(Eval: Boolean); begin if Eval then begin /* do stuff */ /* do more stuff */ end; /* no Exit needed,but now we got what I think unpleasing code: having a indentation level and a begin-end statement */ end;
解决方法
我可以只是提出一个请求,如果你使用第二种形式,你不会添加一个免费的等级的缩进.所以insrtead的:
procedure MyProc(Eval: Boolean); begin if Eval then begin /* do stuff */ /* do more stuff */ end; /* no Exit needed,but now we got what I think unpleasing code: having a indentation level and a begin-end statement */ end;
说:
procedure MyProc(Eval: Boolean); begin if Eval then begin /* do stuff */ /* do more stuff */ end; /* no Exit needed,but now we got what I think unpleasing code: having a indentation level and a begin-end statement */ end;