Hacker News new | ask | show | jobs
by ben509 1869 days ago
Big-endian is natural when you're comparing numbers, which is probably why people represent numbers in a big-endian fashion.

Little-endian is natural with casts because the address doesn't change, and it's the order in which addition takes place.

1 comments

I feel like big endian is more _intuitive_ because that's what our number notation has evolved to be.

But more _natural_ is little endian because, well, it's just more straightforward to have the digits' magnitude be in ascending order (2^0, 2^1, 2^2, 2^3...) instead of putting it in reverse.

Plus you encounter less roadblocks in practice with little endian (e.g. address changes with casts) which is often a sign of good natural design

I'm curious how you're defining "natural", and if you think ISO-8601 is the reverse of "natural" too.

All human number systems I've ever seen write numbers out as big Endian (yes, even Roman numerals), so I'm really struggling to see how that wouldn't be considered natural.

Counting out change is little endian - usually you start cents then dollars.

I wonder if we went big endian “by mistake” with Arabic numerals given that Arabic is written right to left.

Some ancient texts have “four and twenty” which is little endian.

We also add commas to large numbers to help with a human processing problem - you have to get to the end of the number to know what the first digit represents and then count backwards (groups of three help).

It seems like it would be a more natural for representing the number when communicating with a human.

But that's not what we're doing here, so it's not entirely relevant.