1. 10
  1.  

  2. 4

    ‘Donkeys in, elephants out’ is a great improvement over Postel’s maxim.

    SIP is an example of bug for bug compatibility where it’s impossible to keep up with all the vendor bugs, and reality is far from the beautiful dream expressed in the RFCs.

    I’ll start doing this in my network code, let’s improve the internet one implementation at a time!

    1. 3

      “Fail fast and hard” is the new maxim? Have we all forgotten how tedious and frustrating it was to work with XML? Some error inevitably sneaks in because somebody forgets to handle orphan surrogate code-points or something, and then everything downstream falls over in a heap, and all the monitoring tools fall over in a heap, and all the automated problem-fixing tools fall over in a heap, and so somebody has to edit the database with a hex-editor or something to get the world up and running again.

      The most promising advice I ever heard on the matter is that a protocol specification should specify how to handle errors too, not just how to handle 100% valid input. The dominant implementation is always going to accept a little more than the specification requires, either due to bugs or quirks, and other implementations will eventually require that latitude, so it’s best for everyone if error-handling is designed rather than an accident of history.

      (yes, if the protocol specification must describe error handling, it might just say “all errors are fatal”. In my experience, writing a strictly-validating parser is much more difficult than writing one which grabs the bits I’m interested in and ignores the rest. If implementors are going to do that anyway, better have a standard way to do it, than a million minor, incompatible variations on a theme)

      1. 5

        Yes? As opposed to silently accepting garbage that’s not discovered until much later, that’s way better. It’s not difficult to generate valid XML. Failure to do so is just laziness and will cause you more problems later.

        XML is not my favorite format by any means, and I don’t use it, but the binary interchange formats I prefer are no more forgiving to crap inputs, either.