logoalt Hacker News

LinXitoWtoday at 10:38 AM1 replyview on HN

But your program HAS to have some invariants. If those are not held, simply reject all the data!

What the hell is really the alternative here? Do you just pretend your process can accept any kind of data, and just never do anything with it??

If you need an integer and you get a string, you just don't work. This has nothing to do with types. There's no solution here, it's just no thank you, error, panic, 500.


Replies

tomberttoday at 3:46 PM

You handle that in the validation layer, like millions of people have done with dynamic languages in the past.