Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 19 May 2011 09:35:09 -0500 Date: Thu, 19 May 2011 07:35:08 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.java.help Subject: Re: [OT] Re: Why would one use += 1 at the place of ++? References: <8762p7upgn.fsf@merciadriluca-station.MERCIADRILUCA> <4t6Bp.534$pi2.511@newsfe11.iad> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 29 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 75.8.126.96 X-Trace: sv3-kVlsrEOadqSCbGJvjpB3uMpxkVQAdp5J0zrj8vW4ZLxHNbcxivMyqjeICDBB2NW1zbb/EVdS+kKEE0K!yMU9WFE3u39SKtySmI1DAa7YPMknWQ+bDKIRqjLQ1fo5OnSNyLR3rc/QxJ5gB6ajqWk3rjtrMp77!oUdDzHyl6HKFBnoV/EqHmpxgk4k5duulA4tA5oZeRlk= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2442 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.help:698 On 5/19/2011 5:03 AM, Eric Sosman wrote: > On 5/19/2011 6:40 AM, David Lamb wrote: >> [...] >> I think ++ exists only because the hardware on which C was developed had >> an addressing mode that did it atomically in the very special case of >> referring to >> something = array[index++]; > > FWIW, some guy named Dennis Ritchie says this is not true. > > "People often guess that [++ and --]were created to use the > auto-increment and auto-decrement address modes provided > by the DEC PDP-11 on which C and Unix first became popular. > This is historically impossible, since there was no PDP-11 > when B was developed." > > "B" is the language from which C inherited ++ and --, and much else. > There seem to me to be two reasons for the ++ and -- operators in C. Typing was slow and inconvenient when C was invented, so there was a motivation to make code terse. C made extensive use of macros that could represent expressions but not statements, so much was done as side effects. I do not understand why those operators exist in Java. They cannot be used without going against style advice in the JLS and Java is not a terse language. Patricia