Re:Making code better with code reviews
by sbilstein on Wednesday July 02, 2014 @11:18AM
(#7977450)
ASCII art? The engineer is describing a low level header format. The RFCs describing many, many low level protocols that deal with bitwise operations on file formats (gzip, http, tcp, etc) all contain plenty of 'ascii art'. Maybe they could have included a link to the RFC for DNS in the comment, but this seems very useful IMO.
[ Parent
| on HN ]
Re:Making code better with code reviews
by raverbashing on Wednesday July 02, 2014 @11:41AM
(#7977606)
// DNS Header
// raw[0:1] ID of the query
// raw[2]
// bit 0 - QR
// bit 1:4 - OPCODE
etc
Easier to write and possibly to read.
Yea definitely, this engineer should deviate from very standard looking easy to visualize format./s
Take a look at this RFC defining websockets written in 2011
http://tools.ietf.org/html/rfc6455#section-5.2
and the RFC for TCP from 1981 (check out section 3.1 describing the header)
http://www.ietf.org/rfc/rfc793.txt
See the similarity? We have over 30 years of consistency here.