News for hackers. Stuff that matters.
Re:Strict APIs vs. Forgiving APIs by jcranmer on Wednesday October 28, 2020 @03:48PM (#24923342)
What if D is "always-use-utf8"? Or, in general, the option being requested is something that places much more stringent restrictions on semantics.

There are two main reasons that users might validly use unknown options. The first is that it's an option with valid semantics in different versions/implementations of the protocol. The other is that you're reusing an option block for many API calls, and some of the options may not be relevant for some of those APIs. For the first use case, erroring out (or at least warning) is usually the superior solution: you don't know what it means, so you can't guarantee that you'll implement it correctly. For the latter use case, ignoring can be a safe solution.

FWIW, there's been a pushback against Postel's Law (which is what the adage you cite is usually called) in more recent times. In particular, it should be emphasized that the law is generally most applicable when you're dealing with multiple interpretations of an ambiguous specification, and is least applicable when the standards are prescribing or proscribing particular behavior.

There are no comments on this comment yet.