r/functionalprogramming • • Apr 07 '26

TypeScript Parse, Don't Validate — In a Language That Doesn't Want You To · cekrem.github.io

https://cekrem.github.io/posts/parse-dont-validate-typescript/
33 Upvotes

35 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Apr 12 '26

[removed] — view removed comment

1

u/pthierry Apr 12 '26

Feel free to pretend it's not a real situation. As I said, "Parse, dont validate" was a very pragmatic response to a very real situation in existing codebases.

Also, in my experience, codes that follow that pattern are not a nightmare to maintain, quite the contrary. There's a reason this article gets around so much: people following it tend to like the result.

1

u/[deleted] Apr 12 '26

[removed] — view removed comment

1

u/pthierry Apr 12 '26

I don't get your position. If you're on board with parsing, then there's a different type before and after parsing, so you don't have less types. If you have less types and dynamic typing, I don't see how you get the level of safety that parsing+types get us.

1

u/[deleted] Apr 12 '26

[removed] — view removed comment

1

u/pthierry Apr 13 '26

Checking data without changing it is not parsing, it's validating. What's the point saying you agree with the parse part if you don't?