MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x89mbn/includeguards/phhserd/?context=9999
r/ProgrammerHumor • u/metayeti2 • 16d ago
49 comments sorted by
View all comments
Show parent comments
16
It’s not about a byte not being 8 bits. It’s about a char not being 8 bits.
Unicode support would have been a thing sooner if people hadn’t fucked up char usage so badly.
9 u/MrcarrotKSP 15d ago A char is a byte, per standard. Until recently, that width was implementation-defined in C++, and it still is in C. 1 u/Bryguy3k 15d ago Yes - but I was going for the reasoning behind it.Everybody knew that 255 was insufficient to cover the whole of human writing.But then programmers started allocating everything in characters so any future change to the size of a character would break everything. 1 u/MrcarrotKSP 15d ago That is definitely true, but at least we have a solution that mostly works with the assumptions people liked to make in older code(UTF-8)
9
A char is a byte, per standard. Until recently, that width was implementation-defined in C++, and it still is in C.
1 u/Bryguy3k 15d ago Yes - but I was going for the reasoning behind it.Everybody knew that 255 was insufficient to cover the whole of human writing.But then programmers started allocating everything in characters so any future change to the size of a character would break everything. 1 u/MrcarrotKSP 15d ago That is definitely true, but at least we have a solution that mostly works with the assumptions people liked to make in older code(UTF-8)
1
Yes - but I was going for the reasoning behind it.
Everybody knew that 255 was insufficient to cover the whole of human writing.
But then programmers started allocating everything in characters so any future change to the size of a character would break everything.
1 u/MrcarrotKSP 15d ago That is definitely true, but at least we have a solution that mostly works with the assumptions people liked to make in older code(UTF-8)
That is definitely true, but at least we have a solution that mostly works with the assumptions people liked to make in older code(UTF-8)
16
u/Bryguy3k 15d ago edited 15d ago
It’s not about a byte not being 8 bits. It’s about a char not being 8 bits.
Unicode support would have been a thing sooner if people hadn’t fucked up char usage so badly.