Codehuskers (@codehuskers) header
Codehuskers (@codehuskers) profile picture

Daily programming tips. Mostly Java.

Joined January 2017
Mobile UX: place the buttons in the order of Cancel/OK instead of OK/Cancel.
Java: When multiple threads share mutable data, each thread that reads or wires the data must perform synchronization.
Java: Return empty arrays or collections, not nulls, from from an array or collection valued method.
Java: Use checked exceptions for conditions from which the caller can reasonably be expected to recover.
Java: If appropriate interface types exist, then parameters, return values, variables, and fields should be declared using interface types.
Java: Using the String concatenation operator repeatedly to concatenate N Strings requires time quadratic in N.
Java: Avoid the natural tendency to represent objects as Strings when better data types exists or can be written.
Java: Applying the == operator to boxed primitives is almost always wrong.