this post was submitted on 07 Jul 2025
1465 points (99.1% liked)

Microblog Memes

8462 readers
2625 users here now

A place to share screenshots of Microblog posts, whether from Mastodon, tumblr, ~~Twitter~~ X, KBin, Threads or elsewhere.

Created as an evolution of White People Twitter and other tweet-capture subreddits.

Rules:

  1. Please put at least one word relevant to the post in the post title.
  2. Be nice.
  3. No advertising, brand promotion or guerilla marketing.
  4. Posters are encouraged to link to the toot or tweet etc in the description of posts.

Related communities:

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

Because 256 is exactly one byte. If you want to add a 257th member, you need a whole second byte just for that one person. That's a waste of memory, unless you want to go to the 64k barrier of users per chat.

[–] Zagorath@aussie.zone 15 points 3 days ago (4 children)

Except that they're almost certainly just using int, which is almost certainly at least 32 bits.

256 is chosen because the people writing the code are programmers. And just like regular people like multiples of 10, programmers like powers of 2. They feel like nice round numbers.

[–] verstra@programming.dev 46 points 3 days ago (2 children)

Well, no. They are not certainly using int, they might be using a more efficient data type.

This might be for legacy reasons or it might be intentional because it might actually matter a lot. If I make up an example, chat_participant_id is definitely stored with each message and probably also in some index, so you can search the messages. Multiply this over all chats on WhatsApp, even the ones with only two people in, and the difference between u8 and u16 might matter a lot.

But I understand how a TypeScript or Java dev could think that the difference between 1 and 4 bytes is negligible.

[–] MyBrainHurts@lemmy.ca 39 points 2 days ago (2 children)

But I understand how a TypeScript or Java dev could think that the difference between 1 and 4 bytes is negligible.

Shots fired.

[–] jaybone@lemmy.zip 4 points 2 days ago

All these tough guys think you can’t bit shift in Java, never worked on a project with more than two people. Many such cases.

[–] ByteJunk@lemmy.world 0 points 2 days ago

Fair point, but still better than wasting a nuclear power plant worth of electricity to solve math homework with an LLM

[–] Lodespawn@aussie.zone 24 points 3 days ago

It'll have to do with packet headers, 8 bits is a lot for an instant message packet header.

[–] ViatorOmnium@piefed.social 10 points 2 days ago

For high volume wire formats using uint8 instead of uint32 can make a huge difference when considering the big picture. Not everyone is working on bootcamp level software.

[–] jaybone@lemmy.zip 5 points 2 days ago

It’s not that they “like it”. It’s ultimately a hardware limitation. Of course we can have 64 bit integers, or however many bits. It’s an appealing optimization.

[–] spongebue@lemmy.world 5 points 3 days ago (3 children)

If each user is assigned a number as to where they're placed in the group, I guess. But what happens when people are added and removed? If #145 leaves a full group, does #146 and beyond get decremented to make room for the new #256? (or #255 if zero-indexed). It just doesn't seem like something you'd actually see in code not designed by a first semester CS student.

Also, more importantly, memory is cheap AF now 🤷‍♂️

[–] SandmanXC@lemmy.world 43 points 3 days ago

While I completely agree with the sentiment, snorting too much "memory is cheap AF" could lead to terminal cases of Electron.

[–] morphballganon@lemmynsfw.com 5 points 3 days ago (1 children)

There would be no need to decrement later people because they're definitely referred to using pointers. You'd just need to update the previous person's pointer to the new next person.

[–] spongebue@lemmy.world 1 points 2 days ago

If it's a numeric ID (0-255) assigned to each person in the group, you'd either need to decrement later people or assign based on some kind of lowest available method, in which case you'd get kinda funny UX when new-member-Jerry can be #3 on the list because he's taking over for old-member-Gerry, or he can be #255 because that's the last spot.

If we're talking about pointers, I assume you mean a collection with up to 256 of them. In which case, there are plenty of collection data structures out there that wouldn't really have a hard limit (and if you go with a basic array, wouldn't that have a size limit of far more than 256 natively on pretty much any language?)

[–] ViatorOmnium@piefed.social 3 points 2 days ago (1 children)

Memory and network stop being cheap AF when you multiply it by a billion users. And Whatsapp is a mobile app that's expected to work on the crappiest of networks and connections.

[–] spongebue@lemmy.world 1 points 2 days ago

It is also used to transmit data including video. I don't think an additional byte is noticeable on that kind of scale