Get the latest tech news
The Byte Order Fiasco (2021)
01 may 2021 @ justine's web page One of the most challenging topics in the C / C++ programming language is how to handle endianness properly. There's a surprising amount of depth here.
That part of the C standard is the legacy of companies like UNIVAC, who didn't agree with John von Neumman's design doc from the second world war for EDVAC, which very clearly laid out that the plan was to have 32-bit little endian two's complement integers. Even Seymour Cray himself admitted that when he chose ones' complement it was because he hadn't yet understood the full meaning of John von Neumman's design at the time. This blog post covers most of the dark corners of C so if you've understood what you've read so far, you're already practically a master at the language, which is otherwise remarkably simple and beautiful.
Or read this on Hacker News