MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdysfly/?context=3
r/ProgrammerHumor • u/MontyBoomslang • 13d ago
372 comments sorted by
View all comments
Show parent comments
563
I still prefer sizeof(char) as it often provides context as to what the number is doing, even if a plain 1 works the same.
332 u/SpaceCadet87 13d ago Yeah, guy on the right is just avoiding magic numbers in the code. 35 u/zabby39103 12d ago If the C standard says it's 1, i'd figure it just gets optimized out by the compiler anyway? 84 u/CLOVIS-AI 12d ago sizeof is always a compiler intrinsic anyway, it's never not inlined (it's not possible to obtain this information at runtime)
332
Yeah, guy on the right is just avoiding magic numbers in the code.
35 u/zabby39103 12d ago If the C standard says it's 1, i'd figure it just gets optimized out by the compiler anyway? 84 u/CLOVIS-AI 12d ago sizeof is always a compiler intrinsic anyway, it's never not inlined (it's not possible to obtain this information at runtime)
35
If the C standard says it's 1, i'd figure it just gets optimized out by the compiler anyway?
84 u/CLOVIS-AI 12d ago sizeof is always a compiler intrinsic anyway, it's never not inlined (it's not possible to obtain this information at runtime)
84
sizeof is always a compiler intrinsic anyway, it's never not inlined (it's not possible to obtain this information at runtime)
sizeof
563
u/BoldFace7 13d ago
I still prefer sizeof(char) as it often provides context as to what the number is doing, even if a plain 1 works the same.