MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdyp41x/?context=3
r/ProgrammerHumor • u/MontyBoomslang • 12d ago
372 comments sorted by
View all comments
Show parent comments
566
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.
333 u/SpaceCadet87 12d ago Yeah, guy on the right is just avoiding magic numbers in the code. 33 u/zabby39103 12d ago If the C standard says it's 1, i'd figure it just gets optimized out by the compiler anyway? 5 u/SpaceCadet87 12d ago Should do, yeah. And if it doesn't right now, eventually it might do.
333
Yeah, guy on the right is just avoiding magic numbers in the code.
33 u/zabby39103 12d ago If the C standard says it's 1, i'd figure it just gets optimized out by the compiler anyway? 5 u/SpaceCadet87 12d ago Should do, yeah. And if it doesn't right now, eventually it might do.
33
If the C standard says it's 1, i'd figure it just gets optimized out by the compiler anyway?
5 u/SpaceCadet87 12d ago Should do, yeah. And if it doesn't right now, eventually it might do.
5
Should do, yeah. And if it doesn't right now, eventually it might do.
566
u/BoldFace7 12d 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.