this post was submitted on 15 May 2025
1164 points (98.6% liked)

Programmer Humor

23853 readers
3148 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] savedbythezsh@sh.itjust.works 14 points 3 weeks ago (10 children)

Are you telling me that no compiler optimizes this? Why?

[–] gamer@lemm.ee 5 points 3 weeks ago* (last edited 3 weeks ago) (1 children)

Consider what the disassembly would look like. There's no fast way to do it.

It's also unnecessary since 8 bytes is a negligible amount in most cases. Serialization is the only real scenario where it matters. (Edit: and embedded)

[–] Croquette@sh.itjust.works 5 points 3 weeks ago

In embedded, if you are to the point that you need to optimize the bools to reduce the footprint, you fucked up sizing your mcu.

load more comments (8 replies)