Hash Code and Checksum – what’s the difference?

I would say that a checksum is necessarily a hashcode. However, not all hashcodes make good checksums. A checksum has a special purpose — it verifies or checks the integrity of data (some can go beyond that by allowing for error-correction). “Good” checksums are easy to compute, and can detect many types of data corruptions … Read more

Conditional logging with minimal cyclomatic complexity

With current logging frameworks, the question is moot Current logging frameworks like slf4j or log4j 2 don’t require guard statements in most cases. They use a parameterized log statement so that an event can be logged unconditionally, but message formatting only occurs if the event is enabled. Message construction is performed as needed by the … Read more