Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.lisp > #33123

Re: TIL: C++17 sequences assignment the wrong way.

From Barry Fishman <barry@ecubist.org>
Newsgroups comp.lang.lisp
Subject Re: TIL: C++17 sequences assignment the wrong way.
References <20190718203039.263@kylheku.com>
Message-ID <7nzhlaglhf.fsf@ecube.ecubist.org> (permalink)
Organization Easynews - www.easynews.com
Date 2019-07-19 10:14 -0400

Show all headers | View raw


On 2019-07-19 03:36:55 +00, Kaz Kylheku wrote:
> C++17 adds a sequence point to assignment. E1 = E2 requires E2 to be
> completely evaluated first, then E1.
>
> Wow, what a jaw-droppingly moronic moment in computing history.
>
> They had the right motivation to fix a flaw, at least in one small area,
> and establish an order where there is chaos.
>
> Then they drop the ball by making it backwards.

[Although I spent a long time using C++, I stopped using it a while back,
and my knowledge of the language has atrophied.]

I presume they were concerned about side effects in things like:

int *p = an_array_of_ints;
for (int i = 0; i < 3; i++) {
  *p++ = *p + 1;
}

I think any importance of the direction of such ordering is lost in a
language rooted in a time when compilers were not very good and side
effects were an important part of optimizing code.

I think the greater importance now on readability, security, and maybe
distributed programming techniques has made using such languages a bad
idea, irrespective of any new semantic tightening.

--
Barry Fishman

Back to comp.lang.lisp | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

TIL: C++17 sequences assignment the wrong way. Kaz Kylheku <847-115-0292@kylheku.com> - 2019-07-19 03:36 +0000
  Re: TIL: C++17 sequences assignment the wrong way. Barry Fishman <barry@ecubist.org> - 2019-07-19 10:14 -0400
    Re: TIL: C++17 sequences assignment the wrong way. Kaz Kylheku <847-115-0292@kylheku.com> - 2019-07-19 16:45 +0000
      Re: TIL: C++17 sequences assignment the wrong way. Barry Fishman <barry@ecubist.org> - 2019-07-19 15:55 -0400
  Re: TIL: C++17 sequences assignment the wrong way. Stefan Monnier <monnier@iro.umontreal.ca> - 2019-07-19 13:30 -0400
    Re: TIL: C++17 sequences assignment the wrong way. Kaz Kylheku <847-115-0292@kylheku.com> - 2019-07-19 18:44 +0000

csiph-web