If you try to create a new object instance and don't assign a value to a required property, you'll get a compile error.
Before this, you had to use constructors with all the required values as parameters.
Now you can also work with object initializers and not worry about members not having a value assigned.
In combination with nullable reference types, you can create a robust design.
P.S. If you enjoyed this post, you will love my weekly .NET newsletter. I write about practical tips on software engineering every week, and more than 15.000+ engineers are already subscribed.
While I was employed, I always worked on a side project.
I tried to devote 30-45 minutes to it every day.
Sometimes, I would try to do everything wrong.
I focused on a few specific things:
• Software architecture I didn't need
• New libraries I will never use in reality
• Overengineering & unnecessary complexity
This wasn't a waste of time because I was on a mission.
My theory was that I would collect many meaningful lessons and build a sense of what bad engineering is.
And this is what happened.
I learned to spot these anti-patterns when they showed up in real projects.