[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [proposal] a new keyword : final
- From: Florian Weimer <fw@...>
- Date: Wed, 24 Mar 2010 21:30:44 +0100
* Eike Decker:
> I am also doing quite a few programming tasks in Java and there, I am
> using the final keyword in appropriate cases and I do appreciate its
> existence, merely because it simplifies analyzing code that is being
> executed in different threads.
The Java experience with final is a rather mixed bag. Most style
guides say that you should use final only for variables and of
primitive type, and for references to objects which are not mutated
through this particular reference. It is considered bad taste to use
final just because you can (even though that's my preferred style).
Would the attitude among Lua programmers be any different? Immutable
data structures are even rarer than in Java, I think, so there'll
probably be even less incentive to use final.
(OTOH, it seems this would make it pretty easy to implement more
efficient closures.)