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

Programmer Humor

24615 readers
928 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
[–] mmddmm@lemm.ee 157 points 1 month ago (15 children)

And compiler. And hardware architecture. And optimization flags.

As usual, it's some developer that knows little enough to think the walls they see around enclose the entire world.

[–] timhh@programming.dev 2 points 1 month ago (12 children)

I don't think so. Apart from dynamically typed languages which need to store the type with the value, it's always 1 byte, and that doesn't depend on architecture (excluding ancient or exotic architectures) or optimisation flags.

Which language/architecture/flags would not store a bool in 1 byte?

[–] mmddmm@lemm.ee 0 points 1 month ago (2 children)

Apart from dynamically typed languages which need to store the type with the value

You know that depending on what your code does, the same C that people are talking upthread doesn't even need to allocate memory to store a variable, right?

[–] Hammerheart@programming.dev 1 points 1 month ago (1 children)
[–] timhh@programming.dev 2 points 1 month ago

I think he's talking about if a variable only exists in registers. In which case it is the size of a register. But that's true of everything that gets put in registers. You wouldn't say uint16_t is word-sized because at some point it gets put into a word-sized register. That's dumb.

load more comments (9 replies)
load more comments (11 replies)