cm0002@lemmy.world to Programmer Humor@programming.dev · 3 days agoTell me the truth ...piefed.jeena.netimagemessage-square143fedilinkarrow-up11.16K
arrow-up11.16KimageTell me the truth ...piefed.jeena.netcm0002@lemmy.world to Programmer Humor@programming.dev · 3 days agomessage-square143fedilink
minus-squareJakenVeina@lemm.eelinkfedilinkEnglisharrow-up29·3 days agoIt’s far more often stored in a word, so 32-64 bytes, depending on the target architecture. At least in most languages.
minus-squaretimhh@programming.devlinkfedilinkarrow-up5·edit-23 days agoNo it isn’t. All statically typed languages I know of use a byte. Which languages store it in an entire 32 bits? That would be unnecessarily wasteful.
minus-squareAux@feddit.uklinkfedilinkEnglisharrow-up1·1 day agoIt’s not wasteful, it’s faster. You can’t read one byte, you can only read one word. Every decent compiler will turn booleans into words.
It’s far more often stored in a word, so 32-64 bytes, depending on the target architecture. At least in most languages.
No it isn’t. All statically typed languages I know of use a byte. Which languages store it in an entire 32 bits? That would be unnecessarily wasteful.
It’s not wasteful, it’s faster. You can’t read one byte, you can only read one word. Every decent compiler will turn booleans into words.