On Tue 14 Aug 2001 00:55, "Espen Harlinn" <[EMAIL PROTECTED]> wrote:
> Pardon me for butting in at this late stage :-)
>
> Since the purpose of coding conventions and guidelines is to make code more
> readable to the majority of developers, wouldn't it make sence to settle on
> something that can
I think then we are all agreed that the format is
/* comment */
if (...) {
...
}
/* comment */
else {
...
}
with mandatory {}s.
For completeness, we should also include chained else-ifs; I think the
following is reasonably uncontroversial:
/* comment */
if (...) {
...
}
/* comment
Pardon me for butting in at this late stage :-)
Since the purpose of coding conventions and guidelines is to make code more
readable to the majority of developers, wouldn't it make sence to settle on
something that can be processed by a utility like gnu indent ??? This way
developers could use a
> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
>> BTW, I am not sure it has been mentioned already. We should enfore
>> {} even for single line block. Since we use plenty of macros that
>> may be expanded to multi lines, it is much safer and consistent
>> to always use {}.
DS>
At 11:58 AM 8/13/2001 -0700, Hong Zhang wrote:
>This style is not very consistent,
> > if (...) {
> > ...
> > }
> > else
> > {
> > ...
> > }
>
>I believe it would better be
>
>/* comment */
>if (...) {
> ...
>}
>/* comment */
>else {
> ...
>}
Yes, absolutely. Being able to put meaningfull
I believe the advantage of
> if (...) {
> ...
> } else {
> ...
> }
is to write very dense code, especially when the block itself is single
line.
This style may not be readable to some people.
This style is not very consistent,
> if (...) {
> ...
> }
> else
> {
> ...
> }
I believe it w
On Mon, 13 Aug 2001, Dave Mitchell wrote:
> Nicholas Clark <[EMAIL PROTECTED]> wrote:
> > Does this mean avoid:
> >
> > if (...) {
> > ...
> > } else {
> > ...
> > }
> >
> > and instead use:
> >
> > if (...) {
> > ...
> > }
> > else
> > {
> > ...
> > }
> >
> > If my interpretation of what
Nicholas Clark <[EMAIL PROTECTED]> wrote:
> > =item *
> >
> > Uncuddled elses: ie avoid C<} else {>
>
> Does this mean avoid:
>
> if (...) {
> ...
> } else {
> ...
> }
>
> and instead use:
>
> if (...) {
> ...
> }
> else
> {
> ...
> }
>
> If my interpretation of what it means is cor