if a=b then
SomeOldStatement
else
AnotherStatement;
should be written as
if a=b then
begin
SomeOldStatement;
end
else
begin
AnotherStatement;
end;
now, you can comment out SomeOldStatement; with exactly the effect you are after, the debugger more accurately follows the flow of the code AND you avoid bizarre side effects in code like
if a=b then
if b=c then
statement1
else
if c=d then
statement2;
else
statement2
else
statement3;
screw up your indenting, get a semicolon wrong, document out a line for testing and holy crap, things get ugly fast.
seriously, try figuring out if the code I just wrote there is even valid without a compiler pass.
now, guess what happens with this:
if a=b then
if b=c then
statement1
else
if c=d then
statement2;
// else
statement2
else
statement3;
also:
if a=b then
statement1;
statement2;
can often do strange things, and even stranger things when you do
if a=b then
// statement1;
statement2;
serious - just get in the habit of ALWAYS having begin ends in all your logic - it makes your code easier to follow, avoids side effects, avoids mental parsing errors, code parsing errors and commenting out side effects.
Plus, an empty begin/end is the same as your no-op.