Any non-trivial codebase out there benefits from Dependency Injection, for two main reasons: to be able to pass in a proxy or a decorated version of the target dependency, or a mock for unit testing …
clean code
The Clean Switch Rules
From all the syntax constructs of modern programming languages, the switch construct is the most prone to degenerate into an unmaintainable mess unless we take aggressive actions. This article introduces the rules to follow to …
The Best Code Review
This article tells the story of the best code review style I know of and discusses the key points you should focus on while reviewing code. By the nature of my activity, I get to …
Presenting Exceptions to Users
Many applications want to present the errors to their users in a nice human-readable form. This article covers some widely used best practices on this topic. Before we even start, let’s make it clear: NEVER …
Avoiding NullPointerException
The terrible NullPointerException (NPE in short) is the most frequent Java exception occurring in production, acording to a 2016 study. In this article we’ll explore the main techniques to fight it: the self-validating model and …