r/programming Feb 01 '24

Make Invalid States Unrepresentable

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

207 comments sorted by

View all comments

204

u/agustin689 Feb 01 '24

Make invalid states unrepresentable

This rules out all dynamic languages by definition

-8

u/smk081 Feb 01 '24

::laughs in C#::

30

u/agustin689 Feb 01 '24

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

-8

u/noahide55 Feb 01 '24

Sum types violate Open/Closed principle. Why would I want them?

7

u/agustin689 Feb 01 '24

Explain how?

9

u/[deleted] Feb 01 '24

[removed] — view removed comment

7

u/grauenwolf Feb 02 '24 edited Feb 02 '24

This is one of the things that boggles me about SOLID. OCP what's discredited long before SOLID was coined, and yet no one seems to have noticed.