Newsgroups: comp.lang.python,comp.lang.tcl,comp.lang.scheme,comp.lang.misc,comp.lang.perl
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.duke.edu!news-feed-1.peachnet.edu!darwin.sura.net!news.sesqui.net!uuneo.neosoft.com!nmtigw!peter
From: peter@nmti.com (Peter da Silva)
Subject: Re: Comparing syntaxes  (Re: What language would you use?)
Message-ID: <id.33KE1.GY@nmti.com>
Sender: peter@nmti.com (peter da silva)
Organization: Network/development platform support, NMTI
References: <39b7ha$j9v@zeno.nscf.org> <39iroi$dui@brachio.zrz.tu-berlin.de> <id.K1JE1.6DK@nmti.com> <39mi58$aeu@brachio.zrz.tu-berlin.de>
Date: Tue, 8 Nov 1994 18:50:40 GMT
Lines: 47
Xref: glinda.oz.cs.cmu.edu comp.lang.python:2495 comp.lang.tcl:21547 comp.lang.scheme:11058 comp.lang.misc:18915 comp.lang.perl:38326

In article <39mi58$aeu@brachio.zrz.tu-berlin.de>,
Reimer Behrends <behrends@buran.fb10.tu-berlin.de> wrote:
> Second, better readability. Historically, the second one was a non-issue
> when += was introduced (or C would look different).

I don't agree. C was designed to be readable by the people designing it.
That doesn't mean YOU find it readable, but it certainly doesn't mean
that readability wasn't a concern.

> In addition, I have
> my doubts regarding the readability issue. If it is so important, then
> we will also need something for x = y + x, x = f(x), etc. If we can live
> without shorthands for these, why not without += etc. as well?

Because "increment X by Y" is a very common idiom, while "feed X through F"
is a rarely used one?

> Actually, there are so many places where expressions get duplicated that
> I doubt it will get much better by fixing a few common occurrences.

Again, it's not simply that you're eliminating a common duplication, but
that you're implementing a common idiom. If that wasn't a concern there
would be no need for "++x" since it can always be replaced by "x += 1".
It's simply convenience.

> : 	foo[bar[0]+bax][bar[1]-baz]

> If you really wrote code as in the above example (I suspect you don't ;-),
> I'd seriously suggest reevaluating your coding style. What's wrong with
> 
> 	i = bar[0]+bax;
> 	j = bar[1]-baz;
> 	foo[i][j] = foo[i][j] + 1;

I don't see that this is in any way easier to read. If anything, it creates
additional semantic noise that has to be considered (are I and J reused
anywhere else, for example?) without removing any complexity.

By the way, I might well write it as:

	0 bar @ bax @ +   1 bar @ bax @ +   foo    dup @ 1 +  swap !

-- 
Peter da Silva                                            `-_-'
Network Management Technology Incorporated                 'U`
1601 Industrial Blvd.     Sugar Land, TX  77478  USA
+1 713 274 5180                       "Hast Du heute schon Deinen Wolf umarmt?"
