Having developed HTTP/2, SPDY, and HTTP/1.1 framers, I can tell you that HTTP/1.1 is by far more error prone. Length encoding (i.e. binary format) is a god-send for reducing bugs.
I'm curious what you think about my analysis of the binary vs text argument: https://www.youtube.com/watch?v=-yxQIRl6Qic&feature=player_d...
Re:Last Call: HTTP2
by Dylan16807 on Friday January 02, 2015 @08:01AM
(#8826597)
Well I was going to give an example of a non-binary format with length prefixing but I've ended up entirely unsure what the definition of 'binary format' is.
Instead I'll say that length prefixing is good and useful but doesn't necessarily provide a correctness advantage over simple delimiters. It doesn't really shine until you've already decided to allow unrestricted binary data inside of strings.
Re:Last Call: HTTP2
by captaincrowbar on Friday January 02, 2015 @10:04AM
(#8826937)
Out there in the real world, people are going to keep putting unrestricted binary data inside of strings regardless of whether or not anyone has decided to allow it.
Re:Last Call: HTTP2
by Dylan16807 on Friday January 02, 2015 @03:17PM
(#8828301)
If you delimit on \0, period, no exceptions or escaping, then I assure you no one will put \0 inside their strings. Same for other trivial schemes.
I think these fears will turn out to be fairly minor in practice. I've been implementing some protocols over the last few weeks (for controlling satellite terminal units), one text based and one binary. It was a huge reminder of how much simpler a well defined binary protocol can be to implement - it took far less time (and a lot less debugging) for the binary one.
Even a well specified text based protocol can have so many surprising edge cases that just don't exist in binary...
It does require a bit more tooling for debugging, but that's not that hard...
With a text based protocol you at least stand a fighting chance, I've done my share of slogging though dumps and I'm not looking forward to a repeat. One of the main reasons I suspect HTTP caught on as fast as it did was because people could actually look under the hood and understand the basics and figure out where things went wrong without resorting to dumping the the data and counting out which variable length header bit got it wrong this time.
HTTP isn't perfect, don't get me wrong (not specifying an end-of-line for the header with a single character was a mistake in my opinion, and there are a few quirks that make a much faster header parser impossible but that's minor stuff).
So, the telnet by hand case will still work, but that's not where the bugs will be, in fact, testing using 'telnet' will quite possible show you a situation inconsistent with the one using the newer version of the protocol. Having two delivery methods for the same data under the hood is a bad idea to begin with.