Talk:Do Not Expose More Than You Want
From APIDesign
(Difference between revisions)
Apidesign (Talk | contribs)
(New page: '''Fixed: f4219513dece''' Regarding "public static final constants": # These are not constants at all if the type is neither primitive nor String. Definitely avoid nonconstant fields, eve...)
Next diff →
Revision as of 05:43, 14 June 2008
Fixed: f4219513dece
Regarding "public static final constants":
- These are not constants at all if the type is neither primitive nor String. Definitely avoid nonconstant fields, even if static and final.
- Why you think public static final Object CONST_EMPTY = new Object(); is not constant?
- True constants can also be problematic because, as mentioned in a previous chapter, the value is inlined into the caller and so cannot ever be changed.
- Java 5 enumerations should be encouraged where the value is arbitrary. A constant is appropriate if the value is independently motivated.
--JesseGlick 00:14, 8 April 2008 (UTC)
- Page 71: The anecdote about the performance of compiled versus interpreted code is duplicted from a previous chapter. It should exist in one place or the other, but not both.
--TomWheeler Sat Apr 12 19:13:37 CDT 2008