Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: Curious compiler warning Date: Wed, 11 Jan 2012 18:18:57 -0800 Organization: A noiseless patient Spider Lines: 35 Message-ID: <1igsg7d3eggiptf23g9vd0flv19ghqs83d@4ax.com> References: <9n64rgF40bU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="JCn9+dUdCQH+ycRezr2Sxw"; logging-data="8273"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Cgp6c2hTsjrpWyOHMnx4Leq+n07cxfGo=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:sPrbMFBWobciFkhdmT940VnuauQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11254 On Wed, 11 Jan 2012 20:05:25 +0100, "Gavino" wrote: >"Roedy Green" wrote in message >news:dnlqg711uq7njg5bi19fhu76cc6ploibb9@4ax.com... >> On Wed, 11 Jan 2012 04:55:00 +0000 (UTC), Novice >> wrote, quoted or indirectly quoted someone who said : >> >> >I'm just wondering why the compiler is so offended by "start--".... >> >> The compiler worries when you compute something and don't use the >> result. If you had said bar( --start ) it would be happy since >> the incremented start is passed to bar. > >No. This would produce the same warning. > >It's nothing to do with not using the result - in the original example, the >result *was* used. It's simply that assigning to a method parameter value is >considered 'bad style', that's all. Oh, my. Bad style. That is bad, isn't it? I am wearing a dark grey sweater and medium brown pants. Is anyone's compiler concerned about my style? "style" and "best practices" get bandied about as if they are sacred. Often, they are merely someone's opinion, and not necessarily a well-thought-out one either. If a parameter is call-by-value, it is available for modification in many languages. Such code is shorter, too. I prefer a concise style. Sincerely, Gene Wirchenko