The author discusses a trend they have noticed in codebases where there is resistance to creating new types, opting instead for complex function bodies and extensions to existing types. They attribute this to a fear of disrupting the codebase’s “grand design” and a misconception that creating new types is a privilege reserved for senior developers. The author challenges this mindset, advocating for the creation of new types to simplify code and improve clarity. They highlight the benefits of creating new types for organizing data and argue that it is not necessary for a type to be reusable to justify its creation. This perspective contrasts with traditional object-oriented design principles, suggesting that the culture around languages like C and Go, where creating new types for specific functions is more accepted, may be more beneficial in practice. In conclusion, the author encourages developers to have the courage to create new types when it improves code readability and simplicity.
https://lmika.org/2025/03/18/dont-be-afraid-of-types.html