Tag: code quality
-
Testing equals And hashCode Using EqualsVerifier
I learned about EqualsVerifier from a technical coach I know. A few months ago we met (not for the first time) at a conference we both spoke at, and after a collaborative hands-on session in ATDD (acceptance-test-driven development) we talked about TDD and ATDD, and how these practices lead to…
-

Code Review: Text-based Monopoly in Java
Originally posted on Code Review Stack Exchange on 07.09.2021. Question asked by user “DexMax” and licensed under CC BY-SA 4.0. Answer provided by me and licensed under CC BY-SA 4.0. Original Question My Code Review Originally posted in 2021 as an answer on Code Review Stack Exchange. Kudos for this…
-

StringBuilder Cargo Cult
This post is based on an answer I posted on Stack Overflow. The code example was submitted as part of the question by Bruno Rozendo under CC BY-SA 3.0.Note: The context is the StringBuilder class in Java. Code examples are in Java. The accepted answer already explains how to do…
-

Clean Code is Not a Style Guide
The term is sometimes used to refer to a specific and opinionated way of writing code, the one described in the popular book “Clean Code” by Robert C. Martin. That book is now over 15 years old, and it contains some good advice along with lots of debatable, dogmatic and…
-

The Purpose of Getters and Setters
First of all, I don’t advocate for getters and setters at all. Don’t use them (especially setters) if you find an alternative. There usually is a better design. I won’t go into that here. I want to focus on a bigger, very common problem: Many of the people who use…
-

Code Review Best Practices Revisited
In the past, my advice for effective code reviews was something along the lines of: Nowadays, after years working (more or less voluntarily) with pull requests, and sometimes without, this has changed quite a bit. My advice is now:
