I've read that post and I agree. I can only speculate that they designed
the API that way either because of premature optimisation - saving the
underlying binary from potentially having to swap the byte order - or
out of laziness and an assumption that it's easy to read four bytes
into an int in whatever programming language is used.


Chris

On Thu, Aug 24, 2017 at 06:56:38AM +1000, Rob Pike wrote:
> I know the use of native byte order didn't come from you, but that's
> lazy and wrong.
> 
> https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html
> 
> -rob
> 
> 
> On Thu, Aug 24, 2017 at 12:12 AM, Wojciech S. Czarnecki <o...@fairbe.org> 
> wrote:
> > On Wed, 23 Aug 2017 10:51:25 +0200
> > Christian von Kietzell <chris...@vonkietzell.de> wrote:
> >
> >> [*1] The data comes from a web browser extension using the native
> >> messaging API, which specifies that messages sent to external programs
> >> are prefixed with the 32-bit length of the message in native byte order.
> >
> > I understand that 'native bo' in this context means 'remote client side
> > endianess'. If so the safest way is to parse incoming request headers,
> > guess byte order from that and tag data as appropriate.
> >
> > If it meant just local2local (local browser talking over lo/pipe)
> > may simply compile endianess variants according to GOARCH.
> >
> > https://godoc.org/go/build#hdr-Build_Constraints
> >
> > --
> > Wojciech S. Czarnecki
> >  << ^oo^ >> OHIR-RIPE
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "golang-nuts" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to golang-nuts+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
Nothing to see here. Move along.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to