Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news.netfront.net!not-for-mail From: Wanja Gayk Newsgroups: comp.lang.java.programmer Subject: Re: Inserting In a List Date: Sun, 7 Apr 2013 17:54:05 +0200 Organization: Netfront http://www.netfront.net/ Lines: 50 Message-ID: References: <19un43xj77bua.vw45l4e2wshi.dlg@40tude.net> NNTP-Posting-Host: 93.130.29.211 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: adenine.netfront.net 1365349971 33599 93.130.29.211 (7 Apr 2013 15:52:51 GMT) X-Complaints-To: news@netfront.net NNTP-Posting-Date: Sun, 7 Apr 2013 15:52:51 +0000 (UTC) User-Agent: MicroPlanet-Gravity/3.0.4 Xref: csiph.com comp.lang.java.programmer:23364 In article , lipska the kat (lipska the kat) says... > >> In fact what does peppering the code with finals do to make it easily > >> understandable to an inexperienced developer ? > > > > In my opinion it's been an unfortunate decision to have a "final" > > keyword instead of a "var" keyword with a "final" default. > > > > Now, I'm a fan of using the "final" keyword everywhere possible apart > > from method and class declarations and I'll give you my reasons behind > > it. > > Your arguments are fair and represent your view of things. > This is fine, however I have a question for you. > > Without getting all *philosophical* about it, > what do you think the point of a variable is? Depends if you're looking at it from a functional point of view or an imperative point of view. From the functional point of view, I'd say it represents a value that is defined by (parts of) the rest of the equation. From an imperative point of view I'd describe it as a named bin that can be refilled with a value. I do find the term "final variable" a bit clumsy though, because in my view these are constants. Unfortunately in the Java world, we're calling these "constants" only, if they're marked "static". Technically that's rather unfortunate, as these are just as "constant" as their non static sisters - they're just forcibly the same for a wider scope (that of the class loader). I guess naming these "final" instead of "const" was a result of not wanting to confuse C-programmers, I think "const" would have been the better name. Kind regards, Wanja -- ..Alesi's problem was that the back of the car was jumping up and down dangerously - and I can assure you from having been teammate to Jean Alesi and knowing what kind of cars that he can pull up with, when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer] --- news://freenews.netfront.net/ - complaints: news@netfront.net ---