Originally Posted by
dmantione
Originally Posted by
jasonf
hmmm... I've been using
[pascal]if not (obj = nil)[/pascal]
is this slower than [pascal]if obj <> nil[/pascal] ?
This is an easy optimization, most compilers will generate the same code for both, including FPC. However, especially in complex bollean expressions, it can be good forr eadibility to remove some parenthesis.
Does it mean it is a better practice to place if's inside other if's, instead of using parenthesis? In example, this...
Code:
if a = b then
if b = c then WriteLn('a = c!!');
... is better than...
Code:
if (a = b) and (b = c) then WriteLn('a = c!!');
Bookmarks