From -8411446862373537350
X-Google-Thread: 7894ca11fe,d47b345505a72a70
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII
Path: g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.alt.net!frodo.cs.rpi.edu!not-for-mail
From: James Kanze <james.kanze@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: for-else: adding else to for loops
Date: Sun, 16 Aug 2009 09:32:41 CST
Organization: http://groups.google.com
Lines: 29
Sender: cppmods@cs.rpi.edu
Approved: stephen.clamage@sun.com
Message-ID: <b3293cf8-8b06-4660-9581-50cadc471a3b@a13g2000yqc.googlegroups.com>
References: <5d82cd6c-2a22-4dd7-8c7d-790b579533ea@d15g2000prc.googlegroups.com>
  <9e9c2ca5-78eb-460c-adec-2ec051c54210@r18g2000yqd.googlegroups.com>
  <E1ihm.95676$BP6.35009@newsfe24.iad>
NNTP-Posting-Host: netlab.cs.rpi.edu
Content-Type: text/plain; charset=ISO-8859-1
To: (Usenet)
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
X-Original-Date: Sun, 16 Aug 2009 05:02:30 -0700 (PDT)
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Xref: g2news2.google.com comp.std.c++:1300

On Aug 15, 9:36 pm, Hyman Rosen <hyro...@mail.com> wrote:
> Ron wrote:
> > the language does not need any more horrendous structure
> > violations

> The required code flow is the required code flow, whether the
> language supports its expression directly or not. Implementing
> the same flow by adding additional boolean variables or
> repeating tests doesn't necessarily improve the readability of
> the code.

But throwing in an else without knowing what the "if" is
definitely destroys the readability.  You repeat the test or use
the added boolean variable so that the reader can see what the
test is---otherwise, he's fully in the dark.

--
James Kanze (GABI Software)             email:james.kanze@gmail.com
Conseils en informatique orient�e objet/
                    Beratung in objektorientierter Datenverarbeitung
9 place S�mard, 78210 St.-Cyr-l'�cole, France, +33 (0)1 30 23 00 34


-- 
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



