News for hackers. Stuff that matters.

aviskase

Re:Robust APIs Are Weird on Monday June 22, 2020 @10:40AM (#23600699)
Wow, that's unexpected attention.

First of all, I agree with all the comments mentioning that being robust implies much more than validation. This article was a take on one example I found curious.

And second, as you may notice, that article was for testers. That's why a certain oversimplification.

Personally, I am on the side of "if the contract is defined, follow it." All the fiddling with supplied data seems fragile and prone to hidden behaviour. But there is a valid argument for cases when your data suppliers have a history of ever changing and/or buggy output. If you pay them money, you can request them to fix it. If they pay you money, perhaps you would consider being more flexible.