From -364482209149274744
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!news.glorb.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: Tue, 18 Aug 2009 12:55:50 CST
Organization: http://groups.google.com
Lines: 42
Sender: cppmods@cs.rpi.edu
Approved: stephen.clamage@sun.com
Message-ID: <999e529c-49b8-4e86-a9de-aa6a545289aa@a26g2000yqn.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>
  <b3293cf8-8b06-4660-9581-50cadc471a3b@a13g2000yqc.googlegroups.com>
  <h6becd$jds$1@news.ett.com.ua>
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: Tue, 18 Aug 2009 02:43:41 -0700 (PDT)
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Xref: g2news2.google.com comp.std.c++:1307

On Aug 17, 9:18 pm, "Balog Pal" <p...@lib.hu> wrote:
> "James Kanze" <james.ka...@gmail.com>

> >> > 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.

> In the OP it was pretty clear what the "if" is, and when that
> branch is called.

It certainly wasn't to me.

> I second, that such cases come up in life, and that a native
> supporting syntax would be ways better than any of the
> alternatives with available tools.

A native supporting syntax for what?  I haven't yet figured out
what the OP wants (except maybe another tool for obfuscation).

--
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                      ]



