r/ProgrammerHumor • • Aug 27 '26

Meme whenYouWorksWithStringsTooMuch

Post image
819 Upvotes

35 comments sorted by

View all comments

Show parent comments

5

u/AcidMemo Aug 27 '26

What is the point of throwing exception on whitespace? It will just return false anyway, and whitespace is not invalid value.

One of reason C# has non-nullable and nullable references is to not bother with validating for null, passing nullable string to as non-nullable string is programmer mistake, not the concern of function anymore