Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <3656450.xVHqiT2VU1@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sat, 19 Nov 2011 18:17:24 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit Subject: Re: Function arguments vs. local variables Newsgroups: comp.lang.javascript References: <4775241.ypaU67uLZW@PointedEars.de> <2394720.ArG6xLiZAS@PointedEars.de> <4ec07ef1$0$28711$a8266bb1@newsreader.readnews.com> <4ec11fb1$0$28605$a8266bb1@newsreader.readnews.com> <4ec15e82$0$28617$a8266bb1@newsreader.readnews.com> <9iles3FnvhU1@mid.individual.net> <1550675.qVoOGUtdWV@PointedEars.de> <9imn3lF61bU1@mid.individual.net> <1543943.qVoOGUtdWV@PointedEars.de> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 22 NNTP-Posting-Date: 19 Nov 2011 18:17:24 CET NNTP-Posting-Host: 18686c41.newsspool2.arcor-online.net X-Trace: DXC=TCBGE?:478>=FQB?mjjV50A9EHlD;3Yc24Fo<]lROoR18kF> Frobernik wrote: >>> function findPos(obj, name, colour, b, c) { >>> name = obj.name; >>> colour = obj.colour; >>> b = 17; >>> c = [{s:'monkey', x:'male', a:3}, {s:'elephant',x:'female',a:7}]; >>> } >>> findPos({name:'df', colour:'green'}) > > […] > In an implementation of similar heuristics, Eclipse JSDT allows function > arguments and variables to be displayed differently. For example, I have > set it up so that it would display argument declarations and references in > bluish italic characters; the identifier in variable declarations in > regular style, but underlined; and local variable references in > normal-colored italic characters. If I were to use your approach, I could > not tell at a glance if an identifier was an argument or a local variable ^ used as > name. I could be ending up assigning to arguments, inadvertently altering > the program flow after that assignment. […]