Taken from said document...
<SNIP>
This document describes the coding standards for Delphi programming as used
in Delphi 4 Developer's Guide. In general, this document follows the often
"unspoken" formatting guidelines used by Borland International with a few
minor exceptions. The purpose for including this document in Delphi 4
Developer's Guide is to present a method by which development teams can
enforce a consistent style to the coding that they do. The intent is for
every programmer on a team to understand the code being written by other
programmers. This is accomplished by making the code more readable by use of
consistency.
This document by no means includes everything that might exist in a coding
standard. However, it does contain enough detail to get you started. Feel
free to use and modify these standards to fit your needs. We don't
recommend, however, that you deviate too far from the standards used by
Borland's development staff. We recommend this because as you bring new
programmers to your team, the standards that they are most likely to be most
familiar with are Borland's. Like most coding standards documents, this
document will evolve as needed.
</SNIP>
-----Original Message-----
From: Bob Osborn [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 17 June 2000 11:38
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Strange compiler error
Steve Teixeira and Xavier Pacheco have formidable reputations as Delphi
authorities and I'm curious about this quotation (I haven't read the Delphi
4 developers guide):
> OBJECT PASCAL
> Parenthesis
> There shall never be white space between an open parenthesis and the next
> character. Likewise, there shall never be white space between a closed
> parenthesis and the previous character. The following example illustrates
> incorrect and correct spacing with regard to parentheses:
>
> CallProc( AParameter ); // incorrect
> CallProc(AParameter); // correct
> Never include extraneous parentheses in a statement. Parentheses should
only
> be used where required to achieve the intended meaning in source code. The
> following examples illustrate incorrect and correct usage:
>
> if (I = 42) then // incorrect - extraneous parentheses
> if (I = 42) or (J = 42) then // correct - parentheses required
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.
As I understand it, extraneous parentheses may cause the compiler a little
extra work to evaluate the expression, but is not "incorrect" per se. 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.
Did the authors state the reasons for their directives?
I come from the "let the compiler do the work" school, so my opinion is that
anything that makes code more understandable is "correct".
Bob Osborn
Osborn Software Design Ltd
Phone:(03) 3883552
Mailto:[EMAIL PROTECTED]
----- Original Message -----
From: James Sugrue <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: 16 June 2000 01:57
Subject: RE: [DUG]: Strange compiler error
> I'm not saying trying to turn this into "I'm right your wrong" thing,
> because it comes down to personal preference I guess, but here is what I
was
> talking about, taken from Delphi 4 Developers Guide by Steve Teixeira and
> Xavier Pacheco.
>
> <SNIP>
>
> OBJECT PASCAL
> Parenthesis
> There shall never be white space between an open parenthesis and the next
> character. Likewise, there shall never be white space between a closed
> parenthesis and the previous character. The following example illustrates
> incorrect and correct spacing with regard to parentheses:
>
> CallProc( AParameter ); // incorrect
> CallProc(AParameter); // correct
>
> Never include extraneous parentheses in a statement. Parentheses should
only
> be used where required to achieve the intended meaning in source code. The
> following examples illustrate incorrect and correct usage:
>
> if (I = 42) then // incorrect - extraneous parentheses
> if (I = 42) or (J = 42) then // correct - parentheses required
>
> </SNIP>
>
>
> -----Original Message-----
> From: Patrick Dunford [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 15 June 2000 19:15
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Strange compiler error
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> > Behalf Of James Sugrue
> > Sent: Thursday, 15 June 2000 14:14
> > To: Multiple recipients of list delphi
> > Subject: RE: [DUG]: Strange compiler error
> >
> >
> > Works fine for me.
> >
> > BTW You do realise you can have
> >
> > if MessageDlg('Are you sure you want to delete this
book?',mtConfirmation,
> > [mbYes,mbNo],0) = mrNo then
> > abort;
> >
> > I think I have also read somewhere that it is not recommended to
> > encase the
> > if statements in () if you can help it. I am open for verification on
that
> > one though.
>
> I think you are wrong.
>
> The coding style I have used is based on one that is designed to improve
the
> clarity of coding. I am not a C programmer.
>
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
>
>
> CAUTION - This message may contain privileged and confidential information
intended only for the
> use of the addressee(s) named above. If you are not the intended
recipient of this message you are
> hereby notified that any use, dissemination, distribution or reproduction
of this message is prohibited.
> If you have received this message in error please notify Progressive
Enterprises Ltd. immediately via
> email at [EMAIL PROTECTED] Any views expressed in
this message are those of the
> individual sender and may not necessarily reflect the views of Progressive
Enterprises Ltd.
>
> This footnote also confirms that Progressive Enterprises Ltd. has swept
this email message for the
> presence of computer viruses. This does not guarantee this message is
virus free.
>
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
CAUTION - This message may contain privileged and confidential information intended
only for the
use of the addressee(s) named above. If you are not the intended recipient of this
message you are
hereby notified that any use, dissemination, distribution or reproduction of this
message is prohibited.
If you have received this message in error please notify Progressive Enterprises Ltd.
immediately via
email at [EMAIL PROTECTED] Any views expressed in this message
are those of the
individual sender and may not necessarily reflect the views of Progressive Enterprises
Ltd.
This footnote also confirms that Progressive Enterprises Ltd. has swept this email
message for the
presence of computer viruses. This does not guarantee this message is virus free.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz