From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d1df6bc3799debed X-Google-Attributes: gid103376,public From: kaz@vision.crest.nt.com (Kaz Kylheku) Subject: Re: Not intended for use in medical, Date: 1997/05/07 Message-ID: <5kqg8d$95@bcrkh13.bnr.ca>#1/1 X-Deja-AN: 240027002 References: <3.0.32.19970423164855.00746db8@mail.4dcomm.com> <5kl9qc$g4d@bcrkh13.bnr.ca> <5kmek2$9re@bcrkh13.bnr.ca> Organization: Prism Systems Inc. Newsgroups: comp.lang.ada Date: 1997-05-07T00:00:00+00:00 List-Id: In article , Robert A Duff wrote: >In article <5kmek2$9re@bcrkh13.bnr.ca>, >Kaz Kylheku wrote: >>>> Yes, legal, but horrible. A good reminder of why Ada does NOT have >>>> the ++ operator built in :-) >> >>By the way, the x++ is just another way of writing the assignment expression x >>+= 1, or x = x + 1 (the latter case evaluates x twice, of course). The real >>``evil'' perhaps is that in C an assignment is an expression rather than a >>statement, so that you can decorate a complex expression with assignments all >>over the place. > >I agree (except I'd remove "perhaps"). There's nothing wrong with >having short-hand notations like "++" and "+=". The language design >flaw in C is that assignments return something "useful", thus >encouraging side effects nested within expressions, like a[i++]. >I'm not against *all* kinds of side effects, but I'm against most of >them, including the one mentioned above. Wouldn't you agree that C++ amplifies this problem greatly by not only allowing assigments to return something, but also by allowing assignments to serve as l-values? And without proper sequencing at that.