On 21.06.2018 00:50, jacobnavia wrote:
> Dear Sir:
Bjarne participated in this group some ten to fifteen years ago. He
continued to participate in clc++m a while longer. But today he just
isn't here, as far as I know, and clc++m is dead.
The range-based `for` loop is not added complexity.
On the contrary, it's a loop with fewer degrees of freedom and simpler
syntax.
Unfortunately it's not supported by ranges, like in Python `for
range(...):`, and while the ranges proposal has a range view that can be
used to loop over integers, that has a technical, verbose, non-intuitive
name -- that to boot has changed during the library's evolution.
So to gain the FULL benefits one has to rely on DIY support or third
party libraries.
Still, the range based `for` loop is without a doubt the loop that a
beginner should start with. It's simplest in both notation and
semantics. As long as you don't delve into the behind-the-scene things.
> The new syntax was supposed to be eaasy to use, but it is not, since it
> introduces yet another way of specifying the same thing that you have
> to remember.
>
> And that for NO REASON... the "old" way was as good as the new one.
>
> Obviously if you put a hard wired preprocessor symbol instead of using
> the standard size() function it looks ugly. But you shouldn't have to do
> that in C++...
>
> The only reason you put that MAX symbol there, is to make it ugly. Or
> you aren't aware of that function?
To me it's obvious that Bjarne intentionally wrote valid C code, so as
to avoid having to present different examples for C and C++.
For valid C code having the array bound as a constant or variable, such
as the `MAX` here, is the common situation.
Arguing by dissecting imagined nefarious motives is fallacious.
I imagine, if this group were moderated, then one rejection reason could
very well be "goes to imagined motive".
It's in my experience an indication of trolling.
> Of course you are but you need justifying "YAST": Yet Another Syntax
> Trash that you have to remember.
Arguing by calling names is also fallacious.
I think it's valid sometimes to call a person, say, "you scumbag", or
more common in Norway, "you bag of shit", as the then Norwegian minister
of the environment Thorbjørn Berntsen called his British counterpart, to
his face. That's not an argument. It's an expression of lack of regard
and lack of respect, stating openly and clearly, helpfully, the
conditions of the social room that the other must now maneuver in.
But using such terms about a technical thing, much less meaningful.
> Avoiding top heavy languages means cutting unnecessary, redundant
> features such as this one.
You will have a hard time cutting features from any language.
Python did it, in the transition from 2.7 to 3.x, but it was a drawn out
and painful process.
Anyway, the range based `for` loop is not unnecessary and redundant;
it's my impression that it's the main workhorse of loops nowadays.
Cheers & hth.,
- Alf