Code Smell 122 - Primitive Obsession
TL;DR: Use small objects instead of primitive ones.
Problems
Code Duplication
Small Objects Missing
Fail Fast principle violation.
Bijection Fault
Subset violations: Emails are a subset of strings, Valid Ages are a subset of Real, Ports are a s...
maximilianocontieri.com2 min read
Miki Szeles
Everything related to test automation
Great writing again Maxi. ๐
I have to admit I am obsessed with primitives. ๐
But I can answer why.
I am not an OOP purist.
Creating objects for the tiniest variables has its price.
You need to put a lot of extra effort to implement them.
And there is also one more advantage:
During the last decades developers were obsessed with primitives.
But it has also a benefit.
We can easily read and write such code.
Just my 2 cents. ๐