r/ProgrammerHumor • • Oct 04 '26

Meme architectureDependentChars

Post image
3.0k Upvotes

372 comments sorted by

View all comments

Show parent comment

262

u/v_Karas Oct 04 '26

this.

wonderd why everyone is talking about C, like there are no other languages.

96

u/Batman_AoD Oct 05 '26

Well, most mainstream languages at least specify their char size, and/or have very few constructs that require knowing its size. C does not specify the size of a char, and you frequently need the sizes of your types.

(That said, as pointed out by other comments, sizeof itself is in units of char, so sizeof(char) is necessarily 1.)

3

u/KellerKindAs Oct 07 '26

C does specify the size of a char. It's exactly CHAR_BITS bits large, which is a value the compiler will know / decide at compile time

0

u/Batman_AoD Oct 07 '26

That specifies how to discover or use the size, not what it is. Obviously by "specify the size" I meant specify the specific "standard" size of 8.

13

u/Senior-Albatross Oct 05 '26

There are no other good languages. To the extent they have anything good they are calling libraries written in C. The only other worthwhile languages are pure machine level code that must be expressed as a gate level circuit diagram. 

11

u/max_465 Oct 05 '26

The rustaceans would like a word.

13

u/Senior-Albatross Oct 05 '26

I have nothing to say to them. 

4

u/DanielMcLaury Oct 06 '26

The sizeof keyword belongs to C. If someone else appropriated it and modified it to mean something else, that's on them.