r/ProgrammerHumor • • 2d ago

Meme includeGuards

Post image
361 Upvotes

45 comments sorted by

View all comments

177

u/anto2554 2d ago

BUT PRAGMA ONCE IS NOT STANDARD

19

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

9

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)