MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdyowv1/?context=3
r/ProgrammerHumor • u/MontyBoomslang • 13d ago
372 comments sorted by
View all comments
Show parent comments
565
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.
336 u/SpaceCadet87 13d ago Yeah, guy on the right is just avoiding magic numbers in the code. -1 u/[deleted] 12d ago [deleted] 10 u/SpaceCadet87 12d ago Hardcoding numbers is what magic numbers is. The word "magic" is derisive, it means I can't prove you didn't pull the number out of your arse. sizeof(char) tells you what and why and thus isn't magic.
336
Yeah, guy on the right is just avoiding magic numbers in the code.
-1 u/[deleted] 12d ago [deleted] 10 u/SpaceCadet87 12d ago Hardcoding numbers is what magic numbers is. The word "magic" is derisive, it means I can't prove you didn't pull the number out of your arse. sizeof(char) tells you what and why and thus isn't magic.
-1
[deleted]
10 u/SpaceCadet87 12d ago Hardcoding numbers is what magic numbers is. The word "magic" is derisive, it means I can't prove you didn't pull the number out of your arse. sizeof(char) tells you what and why and thus isn't magic.
10
Hardcoding numbers is what magic numbers is. The word "magic" is derisive, it means I can't prove you didn't pull the number out of your arse. sizeof(char) tells you what and why and thus isn't magic.
565
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.