Q: Big or little endian, which is best?
A: The answer depends on if you are focusing on the characters in the text (LTR-data) or the bits in the number (RTL-data):
At the core of the problem is that:
- individual characters in a text are counted LTR (left-to-right)
- individual bits in a number are counted RTL (right-to-left)
Assuming you have a binary number and some text in the memory like this: (dumped LTR)
0
|
1
|
2
|
3
|
4
|
5
|
513 (0x0201) (0b0000001000000001)
|
"a"
|
"b"
|
"c"
|
"d"
|
Which of course also can be dumped RTL:
5
|
4
|
3
|
2
|
1
|
0
|
"d"
|
"c"
|
"b"
|
"a"
|
513 (0x0201) (0b0000001000000001)
|
Anyone focusing on the character-order in the text will prefer LTR and big-endian.
Anyone focusing on the bit-order of the number will prefer RTL and little-endian.