[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bindings and assignments (was: Re: continuations)



Shriram Krishnamurthi wrote:
 > Two related, necessarily somewhat vague, questions:

<sperber-mode>
  Just to be clear, the answer to the original question is, yes, a
  syntactic distinction does exist.  The following questions are along
  the lines of, yeah, but is it this facility used in practice?
</sperber-mode>


 > 1. What do the main Java texts/books say about this?  Do they (a)
 > emphasize its existence, (b) provide useful guidelines on its use

I dunneaux.  Haven't read a mainstream book in a long time.  I looked
up "final" in the index of "Effective Java" by Joshua Bloch, and he
doesn't seem to say anything about the use of "final" for local
variables, although he does say a great deal about other uses of this
keyword.  (I may have overlooked a reference though.)

 > 2. Do practicing programmers use it much?

Judging by code I looked at, most Java programmers don't think in
terms of let/set/set!.  They don't use the "final" keyword to declare
local variables.  Those who do are in the minority.  (The only guy I
know of who does this more or less consistently has also been known to
write small utils in Scheme on occasion, so he doesn't count.)
Personally, I use this idiom rather infrequently.

This, of course, is anecdotal and not based on any hard numbers.