Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 08 Apr 2013 02:54:42 -0500 Date: Mon, 08 Apr 2013 08:54:41 +0100 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Inserting In a List References: <19un43xj77bua.vw45l4e2wshi.dlg@40tude.net> <8MWdnbEIVKIMXfzMnZ2dnUVZ8tednZ2d@bt.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 43 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-smSHFjaQn06LLI0ICPNzLXR1Ss1sHeyLPBoxpe4Ahxrzwk9HFB0VtaDod/n93aL5BautQof42pYoB5V!Sgay0DMppE1z9IWyFbaw1XuMIPVE6Ao/Z7INokdm+FDZGQxbYABA1EfHzxQ9kbjN3W9UNrGStm8= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com 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: 3557 Xref: csiph.com comp.lang.java.programmer:23377 On 08/04/13 07:28, Robert Klemme wrote: > On 07.04.2013 20:53, lipska the kat wrote: > >> I'm probably not the most experienced developer here, 15 years and >> counting with Java but I've done everything from Swing based desktop >> stuff (yuk) to back end business applications that are presentation >> layer agnostic, to state machines that communicate with hardware devices >> and apart from one particular instance I can't think of a single time >> that I have ever had to use final more than once or twice in a >> component. Most components don't use it at all. What are you guys >> *doing* that you feel the need to modify all your variables with final >> everywhere. > > As Arved I think "everywhere" is exaggerated. Some said they do it > habitually because they got used to it and found it useful. That > doesn't necessarily mean that every single item which could be > "finalized" is indeed. > >> The whole point of a computer is to transform it's input to >> some useful output, you store your input, transform it (by updating >> variables usually) and emit it in a way that makes sense at that time. > > Making those things which are mutable to stand out vs. those which > aren't helps when there are a lot variables around. > > One example: I had to modify a 600+ lines method (yeah, ugly). I > started with refactoring because otherwise I would have had zero chance > to fully understand what the code actually did. In the process I > started with moving variable declarations to the most restricted scope > and making things final. That helped my a great deal in understanding > the logic. Then I refactored appropriate parts into separate methods. > This is the kind of experience that led me to find "final" useful. I would be prepared to wager that when you had finished refactoring, your method local variables were largely *not* final. Was this the case ? lipska -- Lipska the KatŠ: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun