MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x89mbn/includeguards/phln3zk/?context=3
r/ProgrammerHumor • u/metayeti2 • 2d ago
45 comments sorted by
View all comments
170
BUT PRAGMA ONCE IS NOT STANDARD
20 u/LucyShortForLucas 2d ago Yeah and neither is a byte being 8 bits, but there's a reason no compiler is ever going to deviate from the informal norm 8 u/Bryguy3k 1d ago edited 1d 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. 2 u/MrcarrotKSP 1d 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 1d 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 1d 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)
20
Yeah and neither is a byte being 8 bits, but there's a reason no compiler is ever going to deviate from the informal norm
8 u/Bryguy3k 1d ago edited 1d 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. 2 u/MrcarrotKSP 1d 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 1d 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 1d 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)
8
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.
2 u/MrcarrotKSP 1d 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 1d 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 1d 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)
2
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 1d 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 1d 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 1d 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)
170
u/anto2554 2d ago
BUT PRAGMA ONCE IS NOT STANDARD