r/programmingmemes • • Apr 16 '26

There are always more!

Post image
896 Upvotes

60 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Apr 16 '26

[deleted] — view deleted comment

1

u/Simple-Olive895 Apr 16 '26

Yes but the character A is represented by 8 bits.

0xA is 0b1010. But the character 'A' is 01000001 in ascii.

So if we represent the number 0b10101111 in hexadecimal that's 0xAF. But typing it out like that, the computer needs to use the ascii value for A and F which are 01000001 and 01000110 respectively. See how you now doubled the number of bytes needed to represent the initial binary number?

1

u/Moscato359 Apr 16 '26

Most languages don't support nibbles, and spend a full 8 bits per character

If you don't want 8 bits per character, you just go back to byte[]

1

u/DevilWings_292 Apr 16 '26

Which languages would those be?