Title: Message
I also use begin/end blocks for readability. If the code is easy to read - it is easier to maintain and less likely to have coding errors in the first place especially with loops and if statements.
The downside is it requires a little more typing but you were going to do that for your documentation any way :-)
 
Maurice
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Ross Levis
Sent: Friday, 23 January 2004 11:28 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Optional Main Form

> IMHO, I'd consider the use of begin..ends essential in any Delphi Coding Standard doco. ;-)
Why make it more complex than it needs to be?
 
if Enabled then a := 1 else a := 2;

Compare that to:
 
if Enabled then begin
  a:=1;
end
else begin
  a:=2;
end;
I would imagine this generates more code and would be slower.  In my opinion, begin/end blocks are designed for when more than one statement is required.
 
Regards,

Ross Levis
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to