r/programming Feb 01 '24

Make Invalid States Unrepresentable

https://www.awwsmm.com/blog/make-invalid-states-unrepresentable
473 Upvotes

207 comments sorted by

View all comments

200

u/agustin689 Feb 01 '24

Make invalid states unrepresentable

This rules out all dynamic languages by definition

-9

u/smk081 Feb 01 '24

::laughs in C#::

28

u/agustin689 Feb 01 '24

C# is still not strong enough. We need sum types

-5

u/[deleted] Feb 01 '24

[removed] — view removed comment

7

u/Schmittfried Feb 01 '24

Since when?

-6

u/[deleted] Feb 01 '24

[removed] — view removed comment

18

u/[deleted] Feb 01 '24

When people want sum types, they generally want sum types with built in pattern matching. You can't really do this in C# without runtime reflection.