3 ms·
> Definitely use to fall for primitive obsession. It seemed so silly to wrap objects in an intermediary type. A lot of languages certainly don't make it easy.
by xboxnolifes 3y ago
> Definitely use to fall for primitive obsession. It seemed so silly to wrap objects in an intermediary type.
A lot of languages certainly don't make it easy. You shouldn't have to make a Username struct/class with a string field to have a typed username. You should be able to declare a type Username which is just a string under the hood, but with different associated functions.
- deleted 3y ago[deleted]
- nogridbag 3y agoWe use this pattern extensively in a large Java app. As long as you establish these patterns early on in the project, the team adapts to the conventions. It's worked well for us and the lack of language support doesn't get in the way much.