Maxi Contieri
banner
maximilianocontieri.com
Maxi Contieri
@maximilianocontieri.com
🎓Learn something new every day.📆

💻CS software engineer / Book Author

http://MaximilianoContieri.com
http://CleanCodeCookbook.com
de manual
November 3, 2025 at 11:02 PM
Refactor with AI 🤖

Ask AI to scan your codebase for functions that use two or more parameters of the same type.

Instruct it to propose an entity name, generate the type or class, and rewrite both the function and its callers to use the new entity.
October 7, 2025 at 12:53 PM
When you ask someone to "search for products with a minimum price of 50 and a maximum price of 100," you use named concepts.

This refactoring mirrors that natural [language structure](maximilianocontieri.com/what-is-wron...) in your code.
What is (wrong with) software?
Software is eating the world. Those of us who work, live, and love software do not usually stop by to think about its meaning. TL:DR: We will address current software design problems in a minimalist way. In university and industry, we use the follo...
maximilianocontieri.com
October 7, 2025 at 12:53 PM
You stop treating the data as loose numbers and give them an [explicit identity](maximilianocontieri.com/code-smell-0...) that matches the domain.

In the real world, you describe searches using named criteria rather than ordered lists.
Code Smell 01 - Anemic Models
Anemic Objects are a very common smell treating objects as data structures with few or missing behavior
maximilianocontieri.com
October 7, 2025 at 12:53 PM
How Does it Improve the Bijection? 🗺️

You move closer to a [one-to-one map](maximilianocontieri.com/what-is-wron...) between the business concept of a "search request" and your code model.
What is (wrong with) software?
Software is eating the world. Those of us who work, live, and love software do not usually stop by to think about its meaning. TL:DR: We will address current software design problems in a minimalist way. In university and industry, we use the follo...
maximilianocontieri.com
October 7, 2025 at 12:53 PM
You enable better IDE support with autocomplete showing parameter names.

You create opportunities to [reuse the parameter object type](maximilianocontieri.com/code-smell-1...) across related functions.
Code Smell 194 - Missing Interval
From date should be lower than to date
maximilianocontieri.com
October 7, 2025 at 12:53 PM
You eliminate the risk of passing arguments in the wrong order since the object properties have explicit names.

You make function calls self-documenting because each value clearly indicates its purpose.

You simplify adding new optional parameters without breaking existing code.
October 7, 2025 at 12:53 PM
Why is the Code Better? ✨

You avoid order confusion and increase readability.

You make functions easy to extend with new parameters.

You bring semantic meaning to the input data.
October 7, 2025 at 12:53 PM
Steps 👣

1. Identify multiple parameters of the same type
2. Create a meaningful entity to group them
3. Add missing validation rules to fail fast
4. Replace function signatures with the new entity
5. Adjust all callers to pass the entity
6. Add context-specific names to improve clarity
October 7, 2025 at 12:53 PM
[Code Smell 01 - Anemic Models](maximilianocontieri.com/code-smell-0...)

[Code Smell 188 - Redundant Parameter Names](maximilianocontieri.com/code-smell-1...)
Code Smell 01 - Anemic Models
Anemic Objects are a very common smell treating objects as data structures with few or missing behavior
maximilianocontieri.com
October 7, 2025 at 12:53 PM
[Code Smell 177 - Missing Small Objects](maximilianocontieri.com/code-smell-1...)

[Code Smell 194 - Missing Interval](maximilianocontieri.com/code-smell-1...)
Code Smell 177 - Missing Small Objects
We see small primitive data everywhere
maximilianocontieri.com
October 7, 2025 at 12:53 PM
Related Code Smells 💨

[Code Smell 87 - Inconsistent Parameters Sorting](maximilianocontieri.com/code-smell-8...)

[Code Smell 10 - Too Many Arguments](maximilianocontieri.com/code-smell-1...)
Code Smell 87 - Inconsistent Parameters Sorting
Be consistent with parameters sorting to avoid mistakes
maximilianocontieri.com
October 7, 2025 at 12:53 PM
Code Smell 177 - Missing Small Objects
We see small primitive data everywhere
maximilianocontieri.com
October 7, 2025 at 12:53 PM
- Accidental [argument swapping](maximilianocontieri.com/code-smell-8...)
- [Primitive Obsession](maximilianocontieri.com/code-smell-1...)
- [Data Clumps](maximilianocontieri.com/code-smell-1...)
- Weak type safety
Code Smell 87 - Inconsistent Parameters Sorting
Be consistent with parameters sorting to avoid mistakes
maximilianocontieri.com
October 7, 2025 at 12:53 PM
Problems Addressed 😔

- Parameter [overload](maximilianocontieri.com/code-smell-1...)
- [Order confusion](maximilianocontieri.com/code-smell-8...)
- [Anemic Models](maximilianocontieri.com/code-smell-0...)
Code Smell 10 - Too Many Arguments
Don't pass more than three arguments to your functions.
maximilianocontieri.com
October 7, 2025 at 12:53 PM