Tag: clean code
-

SRP Misunderstood
The Single Reponsibility Principle (SRP) is commonly misunderstood. Often you might hear explanations like “a class should do only one thing”, sometimes even extended to methods. Here’s a heuristic that I think might help: This may not only lead to less-bad code, but as a side effect also to a…
-

Expressive Tests in JUnit 5 Using Nested Test Classes
I discovered some nice features in JUnit 5 that I haven’t really seen before in the wild, so I thought I’d share them with you. Testing frameworks like JUnit allow for pretty expressive tests if used well. Features I’ve already been using a lot for some time now are things…
-

On Line Length Limits
At the beginning of a new project, when the team (or the team lead) chooses a coding style, a common approach is to use a popular style guide for the programming language and make one or two minor adjustments. Like, for example, using Google’s Java style guide, but with 4…
