delphi – 什么是更好的选择?

前端之家收集整理的这篇文章主要介绍了delphi – 什么是更好的选择?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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;
原文链接:https://www.f2er.com/delphi/101492.html

猜你在找的Delphi相关文章