>> Never include extraneous parentheses in a statement.
>> Parentheses should only...

> I'd like to know the context in which it was written.   Is this part of a
> coding style specification?  If not it sounds like  "thou shalts" delivered
> from on high.

It has to be 'code style' as there is certainly no pascal grammar limitation
preventing use of parentheses here and as parentheses only indicate
operator precedence there is also increase in code output...
 
> As I understand it, extraneous parentheses may cause the compiler a little
> extra work to evaluate the expression, but is not "incorrect" per se.

The compiler as it builds its parse-tree (implicitly or explicitly) will throw away
parentheses as they do not form a parse-node only the order in which nodes
are constructed...

>  If I'm correct on that point, then it comes down to coding style.  Similarly
> for the white space between a closed parenthesis and the previous character.
> I believe the compiler ignores whitespace.

Not quite correct.  The compiler uses whitespace as a delimiter but not a parse
token - as such the fact that whitespace is present is registered but the content
of the whitespace is not significant.  The grammar must declare that whitespace is
acceptable between two tokens in a statement for the compiler to accept it... This
is thankfully done quite consistently.

> I come from the "let the compiler do the work" school, so my opinion is that
> anything that makes code more understandable is "correct".

I'll match that and state that there really needs to be a 'requirement' for tight
optimisation to force obfuscation of code... Unfortunately often performance is
an issue if only a low-priority one.

--
Talden@home


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to