Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Stylistic note on loops

Path: g2news2.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 05 Nov 2010 22:26:19 -0500
From: c...@tiac.net (Richard Harter)
Newsgroups: comp.lang.java.programmer,comp.lang.c
Subject: Re: Stylistic note on loops
Date: Sat, 06 Nov 2010 03:25:28 GMT
Message-ID: <4cd4c6f4.200761945@text.giganews.com>
References: <i9ptik$rcd$1@news.eternal-september.org> <yOydneJouKzoXF3RnZ2dnUVZ_q2dnZ2d@earthlink.com> <style-20101022011700@ram.dialup.fu-berlin.de> <semicolon-20101022013931@ram.dialup.fu-berlin.de> <i9r03t$ppg$1@news.eternal-september.org> <loops-20101023023312@ram.dialup.fu-berlin.de> <493ce92e-97c0-47e2-8713-2b0ab384e517@x42g2000yqx.googlegroups.com> <i9v341$2so$1@news.albasani.net> <Xns9E229549284CCjamesdowallen@78.46.73.112> <iajk3j$vj8$1@news.eternal-september.org> <8j5sjtF51nU2@mid.individual.net> <C-20101031200839@ram.dialup.fu-berlin.de> <8j61r6F51sU1@mid.individual.net> <lnlj5em26m.fsf@nuthaus.mib.org> <23edfcb4-4d39-4713-a351-1cb20ad3fa17@h21g2000vbh.googlegroups.com> <lnlj57cogn.fsf@nuthaus.mib.org> <semicolon-20101106012224@ram.dialup.fu-berlin.de> <lnhbfvcknr.fsf@nuthaus.mib.org>
X-Newsreader: Forte Free Agent 1.1/32.230
Lines: 34
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-53BjeQ3+MLfQWYXKMe7OJBSidJmUXFKDMLtNTYPcjLcI2lc5D8IVDRweWkiep8s28XDg5KfH8/E4xux!oIOd7+meqRDK9JYUm8CILxi7qcAXy2UB55fwMrJccB+/feTBXkmI0qoU+L4JwevRBA==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2589

On Fri, 05 Nov 2010 18:20:40 -0700, Keith Thompson
<ks...@mib.org> wrote:


>
>No, it wouldn't.  The problem with the original version:
>
>    while (*p++ = *q++);
>        do_something;
>
>is that it's hard to be sure whether the author messed up the
>indentation on the second line:
>
>    while (*p++ = *q++);
>    do_something;
>
>or added an unintended semicolon:
>
>    while (*p++ = *q++)
>        do_something;
>
>Braces would make it obvious which was intended.

Have you ever actually seen a case where the semicolon was
actuallly unintended?  I haven't but I suppose someone must have
sometime, somewhere.  On the other hand I've seen lots of messed
up indentation.

Personally I think all of these little gimmicks to indicate an
empty body have less than no value; they are just noise.  YMMV.
Oh yes, semicolons are quite alright.  We agree on that.