DEV Community

Discussion on: Start using fields in C#. Using properties is not a good habit and won't do you any good...

Collapse
 
lukaszreszke profile image
Łukasz Reszke

Yup, it's a little bit click-bait'ish... 😅

"In case the ZIP Code is required in more than one place and circumstances allow it, I like to use a separate Struct instead of just a String. That way I can keep the entire ZIP logic and string formatting in one place and reuse it wherever I need it." - Great example. I would use something similar to struct - Value Object. But that's for another topic :)

thanks for comment, Sebastian!