Netstrings are so brilliantly simple, see the wikipedia page: https://en.wikipedia.org/wiki/Netstring
This is what DJB says about the netstrings [1]:
> The famous Finger security hole may be blamed on Finger's use of the CRLF encoding. In that encoding, each string is simply terminated by CRLF. This encoding has several problems. Most importantly, it does not declare the string size in advance. This means that a correct CRLF parser must be prepared to ask for more and more memory as it is reading the string. In the case of Finger, a lazy implementor found this to be too much trouble; instead he simply declared a fixed-size buffer and used C's gets() function. The rest is history.
> In contrast, as the above sample code shows, it is very easy to handle netstrings without risking buffer overflow. Thus widespread use of netstrings may improve network security.
[1] http://cr.yp.to/proto/netstrings.txt
BTW, see Aaron Swartz's blog post on DJB, http://www.aaronsw.com/weblog/djb