Everybody is playing Worldle these days…

And I love TDD.

So, let’s get moving…

TL;DR: With just a few steps we can build a robust Worldle.

Defining a word

The minimum information amount in Wordle is a word.

We can argue that *letter* is smaller, but we think all needed letter protocol is…

Incomplete objects cause lots of issues.

Photo by Brett Jordan in Pexels


  • Mutability
  • Incomplete objects
  • Concurrency inconsistencies between creation and essence setting.
  • Setters


  • Pass the object’s essence on creation


  • Some persistence frameworks in static typed languages require an empty constructor.


  • Stateless objects. Always better solution than static class methods.

Sample Code



Photo by Stacey Vandergriff on Unsplash

Protocol is empty (with setters/getters).

If we ask a domain expert to describe an entity he/she would hardly tell it is ‘a bunch of attributes’.



1) Find Responsibilities.

2) Protect your attributes.

3) Hide implementations.

4) Delegate


  • DTOs

Sample Code



TL;DR: Don’t name your variables as Data.


  • Readability
  • Bad Naming


1. Use role suggesting names.

2. Find names in the Bijection.


We use ‘data’ a lot in our variables.

We are used to doing it.

Using this kind of name favors the anemic treatment of objects.

We should think about…

Image by Tumisu from Pixabay

TL;DR: Name all your magic numbers

Problems Addressed

  • Readability
  • Complexity
  • Code Reuse

Related Code Smells


1. Move the constant code fragment to a constant declaration

2. Replace the values with a reference to the constant.

Sample Code


double energy(double mass) {
return mass * 300.000 ^ 2;


//1. Move the constant code fragment to a constant…

Photo by Dan Nelson on Unsplash

TL;DR: Don’t test your private methods.


  • Breaking Encapsulation
  • Code Duplication


1. If your method is simple, you don’t need to test it.

2. If your method is complicated, you need to convert it into a Method Object.

3. Do not make your methods public for testing.

4. Do not use…

Maximiliano Contieri

I’m senior software engineer specialized in declarative designs. S.O.L.I.D. and agile methodologies fan.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store