DEV Community

Discussion on: How to get rid of the `new` C# keyword

kiritchoukc profile image
KiritchoukC Author

Maybe I didnt get it right but if you do that you won't get type checking anymore.
Because then a string can convert to a Name or a FirstName.

mrpmorris profile image
Peter Morris

Yes it can, but you can just as easily pass the wrong string value to your constructor.

It's not string to FirstName you are trying to prevent, it is FirstName to LastName.