In Rust, I prefer private struct fields and validated constructors when a type represents a domain invariant. It prevents callers from constructing invalid values and reduces the need to repeat validation throughout the codebase. 🦀
#Rust #SoftwareEngineering
