On Sun, Oct 19, 2008 at 5:58 AM, Sean Owen <[EMAIL PROTECTED]> wrote:

> 1. serialVersionUID should not be used.


+1


> 2. Javadoc that just read (non-javadoc) with a @see tag, or just has
> [EMAIL PROTECTED], adds no value and can be removed.


+1

I read Grant's comments, but I would rather have an indication that the code
has no javadoc.


> 3. UpdatableFloat/Long -- just use Float[1] / Long[1]? these classes
> don't seem to be used.


I think that these came from code I had for counting things.  long[1] is
probably a bit better in terms of storage, but slightly more opaque and
long-winded.

+1 on the removal.


> 4. floats to double? are there cases where storage is important enough
> to sacrifice precision and CPU time?


+1

No cases that I know of where floats actually help in our code and there are
bound to be places where they hurt.


> 6. I never declare RuntimeException subclasses in a method signature.


+1

Furthermore, I try to follow the Spring philosophy that if the intermediate
caller doesn't have much of a chance of fixing the problem, then it should
be an unchecked exception.

Thus, index out of bounds, numerical instability, bad argument and bad
encoding cases should be runtime exceptions.  Any code where you find people
repacking exceptions into runtime exceptions to meet external API
requirements or where exceptions have to be declared but nobody ever catches
them except the framework are prime candidates for this treatment.


-- 
ted

Reply via email to