Clean Architecture, Onion Architecture, and Hexagonal Architecture (aka Ports-and-Adapters) have become the norm for backend system design today. Powerful influencers have promoted these architectures without stressing enough that they are (overly)complex, exhaustive blueprints that need …
Practical Tips
Design Insights from Unit Testing
tl;dr When tests are hard to write, it’s because they are trying to tell you how the production design can be improved. Probably the biggest breakthrough during my Unit Testing workshop is to realize that …
Control your Data Structures
Complex logic should be implemented on data structures you have full control on: an internal Domain Model that you can tailor to your problem to simplify your code. Key Terms Here is an (opinionated) list …
Live Streaming Setup
This article reviews my hardware and software setup for live-streaming and summarizes the tricks I use to increase the engagement of my audience during my online webinars and conference talks. Hardware Yeti Nano microphone – …
Exploratory Refactoring
This article describes a technique that I believe is missing from our practice, especially from teams working on complex (legacy) systems. The Problem I can’t refactor this code because I don’t know what happens in …
Pragmatic Dependency Injection
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 …
Resurrection of the Coding Guidelines Document
I recently got a lot of ideas from the comments I got to a recent post on LinkedIN. The purpose of Code Review is learning, not blaming. But I won’t discuss code review nor pair …
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 …
Exception Handling Guide in Java
This article presents a pragmatic, clean approach to working with exceptions in the Java applications we build today.
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 …
Exceptions and Streams
Java 8 gave us Optional, a mighty weapon against the most frequent Exception in Java: NullPointerException, that I talked about in this blog post. However, Java 8 also brought new headaches regarding exceptions, as the …
Hide Checked Exceptions with SneakyThrows
Java is the only programming language in the world that has checked exceptions, which forces the caller to know about the individual exception types thrown by the called function. What do you do when you …
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 …
Hello World, Hello Blog!
I’ve been postponing starting a blog for too long already. Let’s give it a try. I am planning to share some bits of what I discuss during the workshops that I do every week, at …