The debate appears to be still raging on if/when the Java final keyword should be be used 😦 It reminds me of the OS debate of the 90’s. What’s your view?
~ by mdavey on May 16, 2012.
Posted in Java
I am not Java developer. Isn’t Java keyword ‘final’ to be used to declare runtime read-only fields? Emphasizing its thread-safety characteristic is a bit off target I think.
Ying said this on May 17, 2012 at 1:24 pm | Reply
It’s not a one to one match but I use readonly in.Net as a statement of intent of the lifecycle of a class as much as optimisation for threadsafety. That said I really wish there was a easy mechanism to declare immutably on a class (and enforce it on members) after construction for that very purpose.
lexmitchell said this on May 21, 2012 at 5:00 pm | Reply
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Blog at WordPress.com.