From 5891778801757637227
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,e92ba5a0251f1ca0
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-06-22 10:09:01 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!kibo.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "Stephen Howe" <SPAMstephen.howeGUARD@tnsofres.com>
Newsgroups: comp.std.c++
Subject: Re: C++0x Wish List (deprecate null statement)
Date: Sat, 22 Jun 2002 17:08:12 GMT
Organization: Taylor Nelson Sofres
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <3d149fdd$0$233$ed9e5944@reading.news.pipex.net>
References: <23b84d65.0206181331.3d79ce9b@posting.google.com>
Reply-To: "Stephen Howe" <SPAMstephen.howeGUARD@tnsofres.com>
X-Trace: mail2news.demon.co.uk 1024765698 mail2news:5972 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Lines: 31
Xref: archiver1.google.com comp.std.c++:12265


"Allan W" <Allan_W@my-dejanews.com> wrote in message
news:23b84d65.0206181331.3d79ce9b@posting.google.com...
> The null statement is error-prone, because it's second nature to
> use a semicolen at the end of every statement -- even where it
> doesn't belong:
>
>     if (a==b);
>         TheyAreEqual(); // Oops! Called when it shouldn't be!
>
> We can't simply make the null statement illegal -- too much legacy
> code. But there are already alternatives today, so we can deprecate it.
>
> My favorite alternative is the "continue" statement.
>     while (*(out++)=*(in++)) ; // Old way

I do not wish to see null statements deprecated, I use this all the time. I
would write that as

while (*(out++)=*(in++))
    ;

Stephen Howe


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



