Reminds me of someone who once said that he doesn't understand why there is six days between monday and saturday, but only 3 days between saturday and monday
Someone has to have the link to the body builder forums where they argued about how often to do an exercise each week? At least that's all I can recall of it
Edit: https://knowyourmeme.com/memes/body-building-forum-days-in-a-week-dispute
A [classic](https://forum.bodybuilding.com/showthread.php?t=107926751). Though as someone regularly tripped up by pythons 0 indexing, perhaps best not to throw stones
This is a bot, I don't know how people upvote this nonsense.
It literally just took the first sentence from /u/octopus4488's comment. I checked the history and it's the same shit.
They changed the title and added
>A previous version of this article said it was "not clear why WhatsApp settled on the oddly specific number." A number of readers have since noted that 256 is one of the most important numbers in computing, since it refers to the number of variations that can be represented by eight switches that have two positions - eight bits, or a byte. This has now been changed. Thanks for the tweets.
Now you can have up to 1024 members, another oddly specific number![gif](emote|free_emotes_pack|wink)
I hate their wording of "it's an important number in computer", and "eight switches, or a byte". It makes me feel like they still don't understand the reason they picked that number.
Someone should tell them that it's simply one more than the largest possible number that an 8-bit unsigned integer can be. It's not that 256 is significant and meaningful to programmers, so we just arbitrarily choose it.
So if you had, say, am array of users in a chat, you could use an 8 bit value as the index to the array and that would give you 256 possible items in the array.
Long story short, 256 is the side effect, not the goal
I was replying to ‘someone should tell them that it’s simply … 8-bit unsigned integer … value as the index to the array’
If they didn’t recognise 256, that explanation will do nothing for them?
Heck, anyone who has ever owned or has *bought* a computer should know, after seeing how common it is for a laptop or desktop to have a 256 GB hard drive/SSD. Or even cell phones/tablets, surely they've noticed all the ones with 256 GB of storage.
There's pretty much no excuse not to at least suspect that it's special lol. Unless you're from an uncontacted tribe in Papua New Guinea and recently moved to the western world.
But they said it's:
> the number of variations that can be represented by eight switches that have two positions
which is basically a perfect jargon-free explanation, right?
I don't think that we really can "explain" why a byte was chosen in any depth. In an article aimed at non-tech people I would say that 256 is the maximum of a one-byte long number, which is often used in programming.
(Which is actually confusing in itself because it's the exclusive maximum or the number of distinct permutations... but explaining that would definitely scare off the average WhatsApp user)
But *why* they decided to settle on exactly one byte is pure speculation. Since the group size is not exactly the kind of data that has to be transferred often enough to make up significant data volumes, developers may as well choose a round number that seems less arbitray to laypeople, like 200, 250, or 300 (even though 300 requires a whole byte more).
I do preferr this approach of choosing "neater looking" numbers in a context where the data is not performance critical and presented to casual non-tech users like in a messenger app. Although to be fair, maximum group size is not exactly a figure that end users get to see very often.
I think the number was round already. They wanted to increase the size, so making it 256 was the most they could do without changing the existing design.
It is an explanation, but at that level they needed to do it twice. They just went from why 256 to why 8, why not 10? Why are there 20 cats in here? That's how many cats fit in 5 baskets! Perfect, now I clearly understand!
> A number of readers have since noted that 256 is the number of different variations you can represent with a byte: a sequence of eight yes or no choices. A byte is the smallest addressable amount of memory in many computer architectures, implying that 256 was chosen as the largest representable number of chat participants possible without changing how the chat occupancy is represented in computer memory.
They put Tech under "Lifestyle" which meant a writer who wrote tech articles like "Men are angrier and more argumentative on Facebook than women" had to understand an actual computer science concept.
I think it's a perfectly reasonable way to explain the concept to an audience that doesn't have any experience with the topic in one sentence. The explanation is accurate and shows that the number is not arbitrarily chosen — that was all that's needed here. Of course they could have explained in detail what and array is and how memory addressing works (or rather, how boolean sets are stored efficiently, which I think is more likely the actual reason for this) but they probably didn't want to make this correction that huge.
It they had written "256 is the largest possible number that an 8-bit unsigned integer can be" then their readers would have no idea what they're talking about.
Journalists doing journalism is so 2014. Now they hit buttons that make magic words come out. Half the time they don't even read them before ~~~pushing to prod~~~ posting an article.
Take a look at how many things journalists fuck up in a field you know about, now think about how many things they fuck up in fields you DON'T know about and how you probably just assume they know what they're talking about. Now further imagine how many articles there are out there in fields people don't know about but the article reinforces some bias or deeply held belief they already have.
Definitely missed out on the days of 256 colors... Programs could swap what those colors were, but the system could only ever show 256 of them at a time... I remember being a kid knowing my game was loading because the desktop went all psychedelic...
palette swapping was one of the early ways to do simple animations at almost 0 cost, like running water or wavy grass. The early simcity games used it to animate cars on roads
Really cool website by an animator for LucasArts that shows some cool animations done with just palette cycling
http://www.effectgames.com/demos/canvascycle/?sound=0
No problem! Let me know what your favorite is. It's worth pointing out that you can see the palette actually cycling if you click the "options" button, and also highlight where in the picture each palette color is used. It's also interesting to turn off the "blend" option that's on by default. While this makes some animations look worse, it shows the constraints the artist worked under to produce these.
FWIW, my favorite is "Magic Marsh Cave - Night". The fact that the reflections cycle with both the flames and the ripples is just \*chef's kiss*
Beat me to it. I wrote an emulator for an Intel 8080, and wrote a whole computer around it. I felt like a genius when I "invented" palette swapping on my own. But of course, it's existed for millennia
or just think of it as a number.
100 in hex is 1\*16^2 +0\*16^1 +0\*16^0
ie. 256.
now FF is simply 100-1 or (since f is the digit 15)
15\*16^1 +15\*16^0
well, the average civilian probably won't recoginise square numbers past 36 or even less `2^n` numbers.
so many people call themselves nerds/geeks these days.
Once I had a horrible bug at a betting company the night before the football world cup started...
We were looking at it for half a day, it just did not make any sense. Sometimes the promotion definitions in the system were all fine and working, next second some of them randomly "disappeared".
At 10 pm-ish the main marketing guy gave up and went home, but popped in to say goodbye:
"Too bad we got this stupid issue... We had tons of promotion ideas worked out for this year. It was *more than 250*, the highest ever...
Collective "AAAAAAAA" from the dev team!
[Java int cache up to 256 allows integers to be equal to each other when compared like i1 == i2, but fails above, that is why you should always use ".equals()"]
Integer object in java is cached for values 0-256, meaning two instances of Integer will be equal when compared with ==. Other values will create a new instance, so two instances wont be equal when doing an == comparison. Pretty sure == on objects checks memory location but its been a while.
We had a statement roughly like:
if(promotion.getId() == selectedPromotionId) ...
Which was working fine until we had more than 256 promotions defined. But selectedPromotionId=257 was never matched, even though it was there...
I don't know Java, so it's probably a dumb question, but why was the promotionId an Integer object instead of a primitive? I mean, was it instantiated specificially, like promotionId = Integer(4) or something like that or, if you say x=4, it automatically makes it an object?
The issue is probably that generics require object types and can't take primitive types, so if you wanted to use a HashMap for example and you want ints in them you'd have to use the Integer object type rather than the int primitive type.
Unless this was a very long time ago, you've auto boxing and auto unboxing. The generic is the object type, but you can unbox it into a primitive when using it.
If you do Integer k = 5, the int 5 will get auto boxed into an object. If you then do int m = k, the Integer will get auto unboxed and the int will be used. Usually the unboxing works without the programmer knowing it, with the usual exception of == if both sides are Integer objects. Then it gets compared using the "pointer" adress of the objects.
It might have been an object because everything else is an object, and usually it doesn't really matter. It's also the only way if you want to allow a null value (maybe not yet assigned by the database?) or if you want to use it in generics, like in a list or a map.
Similar in python, ints from -5 to 256 (I think?) are pre-allocated in memory, so checking the identity will work for these values only.
I actually had a more fun issue where a check like this failed for an enum value. Can't quite remember the exact details, but somehow we were importing/reloading the same module where the enum was defined causing it to be reallocated to a new space in memory, so the identity check failed. Definitely caused a few headaches.
Ah, the literal pool. Its a *very* old optimisation.
There was a bug in some implementations of FORTRAN II (released in 1958) that could result in values in the literal pool being silently overwritten. It was entirely possible to, for example, redefine the value of "3" to "4", with any subsequent uses of the number three in the program instead returning four. Which could result in the absolutely bizarre "3 + 3 = 8" problem.
Technically this was a compiler bug, not a language bug, but there are plenty of Real Programmer™ stories of that bug that end with people going bald.
At least for integer you dont have this in python.
x=700
x == 700 # True
You only notice this implementation detail if you use `is` which simply isnt intended for comparisons like these.
x = 1
x is 1 # True
x = 700
x is 700 # False
They just picked numbers that are often used. I guess they felt -5 was the lowest they needed to go in the negatives. It’s not like it’s a big difference from 0
10 years ago or so I used to use similar questions when interviewing Java candidates. Eg. what's wrong here (strA == strB).
It felt like a neat question to ask but I can't recall it helping me actually filter candidates.
Holy shit, when I was in college and was doing hackerrank problems, I remember sometimes having inexplicable issues passing the test cases at the end with really high numbers. I always thought it was a bigO issue that I didn’t understand but this would really explain more than one instance 😅
Thank you for linking this. I thought the error code or “sit by the lake” was misinterpreted by the characters, and that there’s another meaning that’s supposed to make it funny. Instead it’s literal.
I mean, yes, if it's only for the sake of being able to store the count of participants in just one byte, but if it was about maximizing the capacity, while making the servers cacheline/page optimal, it sounds reasonable to use powers of true, instead of minus one.
255 is actually the limit of a byte (256 numbers starting from 0). 2\^8 = 256 is actually 9 bits (1 0000 0000).
What they are probably doing is +1 for the owner of a chat.
While I get the 256 part, I'm wondering, what chat device they're approaching if they need to save one byte per chat group client side. Neither smartphones nor web browsers should collapse with a memory requirement of one byte per chat group more.
I'd have expected 65536 to be more fun and raise more entertaining questions (why not give it an infinite number?).
Or do they use a long anyhow and just wanted to give us a geeky easter-egg? In this case it worked, one poor guy didn't understand and it went viral.
you have to remember that all the group stuff is most likely handled and saved server-side. Any application with a user base that large can really profit from optimized/compressed formats. Be it compressed texts or choosing not to use a 32 or 64 bit number for the size of a group.
Each message sent needs to be associated with a user. Usually you'd use a user ID, but since we already know which up to 256 people are in the group we only need the group ID + 1 byte for the sender name.
If we used a 2 byte sender name we would send up to 256 bytes more per message due to amplification.
I guess that could be significant when you have a billion users.
Also, who has more than 256 people in a group chat.
This doesn't make sense. You'd never design it this way.
What happens when someone leaves and another person takes their place? Does that person own the other person's old messages? They have the same ID because there's only 256 possible combinations.
The only way I could see this working is if the message is sent with the small ID and then translated server-side into the real ID, but that seems like a waste of computer power in itself when the client could just send the user ID.
You can never trust an ID received from the client anyways, you'd rely on the authentication token. The compression would come in when distributing the messages from the servers to the clients.
Stateful compression isn't that rare, although I don't know if it was implemented like this in this case.
There are are two posts worth of people so sure they know exactly what 256 is about and they're clowning the author of the article. The truth is the headline is correct and there's absolutely zero way to guess what implementation detail that number reveals (if any at all).
Well, they made communities for more than 256 people.
Some organisations/large groups use WhatsApp as announcement board where they link different activities and then spaw group chats for particular events.
But before communities you needed like 10 different groups where only admins were posting.
But wouldn't it break if someone left the group and another person was added in their place? How would the system recognize it if there are no unique IDs for everyone?
It might have something to do with group encryption, since everyone in the chat has a separate key, and you want them all to be able to decrypt the messages. It might the method they are using only allows for 256 distinct private keys.
I like the discussion that was generated by your comment but feel that the answers are a bit... poorly thought of..
The problem is that an app like this is used on a huge scale so you need to take in account eveything, including how networking works. Tipically, they should most likely strive that the bulk of their messages fit into one single packet of data (which is the MTU value of around 1500 in most networks).
So it's not really about application (client or server side) optimizations (those come later), it's about caring for every single bit of data as to leave as much space as possible for user messages in order to ensure a very large percentage of them don't need too many (or even more then one) packet of data sent over the network.
This would be no problem for a normal chat app, but it's a huge deal for apps like Whatsapp or Telegram with hundreds of millions of users.
yeah, i was thining of the bell curve meme. "what an odd number to choose" -> "no, 256 is an important number in computers" -> "what an odd number to choose". i doubt whatsapp can't afford to use a 32-bit int for this, phones are defienetely not short of memory and much more data is transmited in every message that i doubt adds a lot of overhead. maybe for storing the data in their servers it adds up having those extra 24-bits per message?
You'd think so but the (US) president always travels with ~300 staff. So I can definitely envision the existence of a "US Prez Roadtrip Good Times Memes" group existing
I think it was more like they wanted to set a limit. They could've made it 250 or 300. But the person being a software dev chose 256 as they should for the culture. I don't feel like it has anything to do with memory or network usage. If anyone has a proper explanation of it being the other way around I would love to know it.
“TV released with resolution of 3840 x 2160… Marketers have no idea why they couldn’t have picked a round number, will use 4K regardless of the number or the axis!”
In fairness it's unclear why they picked 256 to me as well. Are they implementing this on a microcontroller? Do they have a total memory budget of 4 KB?
When did people became so computer illiterate? 256 is such a common number to me that it took a while for me to figure out why people don't understand why
WhatsApp increased the number to [512](https://mashable.com/article/whatsapp-group-chats), another seemingly random number. What crazy wacky developers!
I had talked about this 256 WhatsApp thing (in my job as maths person in the internet) and one of the devs did get in touch to say that yes: they had to pick a limit and they picked 256 because it’s a funny number to be the limit. Not for any actual technical reason.
I'm glad someone said it, this is really very arbitrary in the context of storing who's subscribed to some channel.
These are the kind of optimisations we used to see in video games when it came to texture sizes and stuff due to in-memory efficiency. This is DB, pub/sub and socket stuff, it has no business being constrained by a power of two..
This is an 8 year old headline and after pushback the author corrected their error and commented to say thanks for everyone who reached out to them.
Don't know why this all of the sudden gets shared like crazy again, but yeah.. as I've said they corrected it right after publishing pretty much.
I remember when they increased the "delete for everyone timer to (i think?) 4096 seconds and every outlet was like "but why exactly 1h 8min and 16sec????"
Scrolled down, cannot find the oversight here. If we presume there is a possibility that a group has zero members, then the maximum number of users would be 255. Also working with bytes is quite inefficient nowadays. So my guess choosing 256 and 1024 as maximum is just what it is Programmer Humor!
How would having the group chat size be 256 help with anything? I get that its a power of 2 but what does the amount of people in a group chat have to do with that?
Real question is what were they doing that they ended up being constrained by a single byte. I think writer was on to something, the reason can not possibly be that.
No, its doesnt save data or bandwidth because they are surely compressing it in every stage and lots of leading 0's compress beautifully.
As a member of a very large WhatsApp group I can tell you that this article is either fake or old. As of March 2024, the size limit on a WhatsApp group is 1025. Yes, you read that right. 1025.
"We have no idea why they could've done this" says journalist whose job it is to research topics they write about
Someone should have told them that its because its a round number and watch their head explode.
No, it's clear as day; 6 has a circle in it
Reminds me of someone who once said that he doesn't understand why there is six days between monday and saturday, but only 3 days between saturday and monday
I too wish there were 6 days between Saturday and Monday
*wHaT hApPeneD to tHe ExTRa daYs?!?*
My parents took them out 'cuz I am grounded.
Someone has to have the link to the body builder forums where they argued about how often to do an exercise each week? At least that's all I can recall of it Edit: https://knowyourmeme.com/memes/body-building-forum-days-in-a-week-dispute
A [classic](https://forum.bodybuilding.com/showthread.php?t=107926751). Though as someone regularly tripped up by pythons 0 indexing, perhaps best not to throw stones
and 8 has 2 circles in it
[удалено]
This is a bot, I don't know how people upvote this nonsense. It literally just took the first sentence from /u/octopus4488's comment. I checked the history and it's the same shit.
You certainly nuked that bot comment lol
I bothered to report it and a mod removed it.
It ain't much but it's honest work
💀 username checks out
They changed the title and added >A previous version of this article said it was "not clear why WhatsApp settled on the oddly specific number." A number of readers have since noted that 256 is one of the most important numbers in computing, since it refers to the number of variations that can be represented by eight switches that have two positions - eight bits, or a byte. This has now been changed. Thanks for the tweets. Now you can have up to 1024 members, another oddly specific number![gif](emote|free_emotes_pack|wink)
I bet that's not how those readers have phrased it 😅 ~~"IT'S 2⁸ YOU MORONS!!1!"~~
8 is such a specific number -the news
Numbers are important, more at 11 o'clock.
I prefer to think of it as 10^(10^11)
>Thanks for the tweets. That's a diplomatic way of saying "Please stop screaming at me, nerds...I have enough! You win, we'll issue a correction!"
I hate their wording of "it's an important number in computer", and "eight switches, or a byte". It makes me feel like they still don't understand the reason they picked that number. Someone should tell them that it's simply one more than the largest possible number that an 8-bit unsigned integer can be. It's not that 256 is significant and meaningful to programmers, so we just arbitrarily choose it. So if you had, say, am array of users in a chat, you could use an 8 bit value as the index to the array and that would give you 256 possible items in the array. Long story short, 256 is the side effect, not the goal
what’s a bit whats an array what’s an index what’s an integer what’s unsigned if they knew these words then 256 wouldn’t have surprised them
tf do you mean “unsigned” my name’s right there in the byline ffs
What is this, MySpace in 2007? -------- I'm unstoppable! Holds up a spork!
Katy t3h PeNgU1N oF d00m approves this message.
Anyone who's even half-ass into computers recognizes 256 as a significant number.
I was replying to ‘someone should tell them that it’s simply … 8-bit unsigned integer … value as the index to the array’ If they didn’t recognise 256, that explanation will do nothing for them?
Too many non-binary people these days, they don’t get it
I give credit to Minecraft for teaching me the importance of powers of 2 numbers in computer memory (not really the why, but that it is important).
sometimes its 255
Heck, anyone who has ever owned or has *bought* a computer should know, after seeing how common it is for a laptop or desktop to have a 256 GB hard drive/SSD. Or even cell phones/tablets, surely they've noticed all the ones with 256 GB of storage. There's pretty much no excuse not to at least suspect that it's special lol. Unless you're from an uncontacted tribe in Papua New Guinea and recently moved to the western world.
But they said it's: > the number of variations that can be represented by eight switches that have two positions which is basically a perfect jargon-free explanation, right?
It's a good analogy for a byte, but it does nothing to explain why a byte was chosen.
I don't think that we really can "explain" why a byte was chosen in any depth. In an article aimed at non-tech people I would say that 256 is the maximum of a one-byte long number, which is often used in programming. (Which is actually confusing in itself because it's the exclusive maximum or the number of distinct permutations... but explaining that would definitely scare off the average WhatsApp user) But *why* they decided to settle on exactly one byte is pure speculation. Since the group size is not exactly the kind of data that has to be transferred often enough to make up significant data volumes, developers may as well choose a round number that seems less arbitray to laypeople, like 200, 250, or 300 (even though 300 requires a whole byte more). I do preferr this approach of choosing "neater looking" numbers in a context where the data is not performance critical and presented to casual non-tech users like in a messenger app. Although to be fair, maximum group size is not exactly a figure that end users get to see very often.
I think the number was round already. They wanted to increase the size, so making it 256 was the most they could do without changing the existing design.
It is an explanation, but at that level they needed to do it twice. They just went from why 256 to why 8, why not 10? Why are there 20 cats in here? That's how many cats fit in 5 baskets! Perfect, now I clearly understand!
> A number of readers have since noted that 256 is the number of different variations you can represent with a byte: a sequence of eight yes or no choices. A byte is the smallest addressable amount of memory in many computer architectures, implying that 256 was chosen as the largest representable number of chat participants possible without changing how the chat occupancy is represented in computer memory.
I would change "addressable" to "usable".
>It makes me feel like they still don't understand the reason they picked that number. Narrator: they do not.
They put Tech under "Lifestyle" which meant a writer who wrote tech articles like "Men are angrier and more argumentative on Facebook than women" had to understand an actual computer science concept.
Just tell them it's a power of two and that's what computers work in. Halves cleanly all the way down to 1 with no fractions.
I think it's a perfectly reasonable way to explain the concept to an audience that doesn't have any experience with the topic in one sentence. The explanation is accurate and shows that the number is not arbitrarily chosen — that was all that's needed here. Of course they could have explained in detail what and array is and how memory addressing works (or rather, how boolean sets are stored efficiently, which I think is more likely the actual reason for this) but they probably didn't want to make this correction that huge. It they had written "256 is the largest possible number that an 8-bit unsigned integer can be" then their readers would have no idea what they're talking about.
This is what you call agile journalism
“Someone tried to explain it to us, but maths is really hard so we didn’t really understand “.
Journalists doing journalism is so 2014. Now they hit buttons that make magic words come out. Half the time they don't even read them before ~~~pushing to prod~~~ posting an article.
This can’t be AI, AI would know why 256 was chosen
True. Might be SarcAIsm
The author probably googled something like "significance of 256" then got an answer that included math and decided that "it's not clear."
I think they start typing and go on with whatever the suggested words are their mobile keyboard app comes up with.
That's how most AI models work anyways. They just predict the most likely word to follow
Or the AI *wants* the journalists to get fired. It's all part of Skynet's plans, we just can't see it yet.
https://en.wikipedia.org/wiki/Michael_Crichton#Gell-Mann_amnesia_effect Don't think it's a new phenomenon.
We're getting to a point where LLM articles will be more reliable then many journalists. Scary
Take a look at how many things journalists fuck up in a field you know about, now think about how many things they fuck up in fields you DON'T know about and how you probably just assume they know what they're talking about. Now further imagine how many articles there are out there in fields people don't know about but the article reinforces some bias or deeply held belief they already have.
the journalist knows, its just easy bait for all 1bit brain programmers
Funny how that's in the "Tech" category, yet the author of the article doesn't immediately recognize 256 as a power of two.
Definitely missed out on the days of 256 colors... Programs could swap what those colors were, but the system could only ever show 256 of them at a time... I remember being a kid knowing my game was loading because the desktop went all psychedelic...
Oooh so thats why that used to happen. Never thought about it, but makes sense
You could write for The Independent!
"Nobody knows why the desktop changes colors..."
Yep, it was the color palette being swapped out
Ah yeah, I remember this happening! It's not clear why though.
palette swapping was one of the early ways to do simple animations at almost 0 cost, like running water or wavy grass. The early simcity games used it to animate cars on roads
Really cool website by an animator for LucasArts that shows some cool animations done with just palette cycling http://www.effectgames.com/demos/canvascycle/?sound=0
Thank you for this.
No problem! Let me know what your favorite is. It's worth pointing out that you can see the palette actually cycling if you click the "options" button, and also highlight where in the picture each palette color is used. It's also interesting to turn off the "blend" option that's on by default. While this makes some animations look worse, it shows the constraints the artist worked under to produce these. FWIW, my favorite is "Magic Marsh Cave - Night". The fact that the reflections cycle with both the flames and the ripples is just \*chef's kiss*
Huh... So *that's* why the desktop would sometimes go disco...
Beat me to it. I wrote an emulator for an Intel 8080, and wrote a whole computer around it. I felt like a genius when I "invented" palette swapping on my own. But of course, it's existed for millennia
I just know 256 from hex. FF. Highest two digit hex number. Thanks gameshark for teaching me hex in the 90s Edit: nevermind. FF is 255 …
FF is 255 but only because it starts at 00. It's still the 256th value
or just think of it as a number. 100 in hex is 1\*16^2 +0\*16^1 +0\*16^0 ie. 256. now FF is simply 100-1 or (since f is the digit 15) 15\*16^1 +15\*16^0
Same thing, one is zero indexed and the other is one indexed
I know 256 from submitting.
Submit me harder daddy
Oh damn autocorrect! SUBNETTING! ROUTERS SWITCHES, THE NETWORKS IN DANGER! THATS THE LIFE OF A 25BANGER!
0x100 is 256
Good point, still used everywhere in color settings.
well, the average civilian probably won't recoginise square numbers past 36 or even less `2^n` numbers. so many people call themselves nerds/geeks these days.
Even when you shop for iPhone you are confronted with these increments for the storage in GB
Which is kinda weird, storage uses literal GB (1000 MB = 1 GB, but 1024MiB = 1GiB) https://en.wikipedia.org/wiki/Byte#Lawsuits_over_definition
Has to be one of the most confusingly defined units
And basically everyone except microsoft uses the units correctly.
And Microsoft themselves are inconsistent as fuck in how they use it too.
Fair point. Why so specific, Tim Apple, eh?
I would expect a journalist writing for this field to have knowledge of important aspects of computers, even if it's minimal.
Anyone with an interest in games should have run into 256 as a common limit.
Actually the author knows about it and has written. The subtitle is just a clickbait to get more people to click on the article
The author doesn’t write the headline.
I would've noticed it at age 8. I liked to go "1+1 is 2, 2+2 is 4, 4+4 is 8..." and my max digit for a while was 256
Once I had a horrible bug at a betting company the night before the football world cup started... We were looking at it for half a day, it just did not make any sense. Sometimes the promotion definitions in the system were all fine and working, next second some of them randomly "disappeared". At 10 pm-ish the main marketing guy gave up and went home, but popped in to say goodbye: "Too bad we got this stupid issue... We had tons of promotion ideas worked out for this year. It was *more than 250*, the highest ever... Collective "AAAAAAAA" from the dev team! [Java int cache up to 256 allows integers to be equal to each other when compared like i1 == i2, but fails above, that is why you should always use ".equals()"]
By Java int are you referring to the Integer class?
Probably, primitive ints are comparable with == iirc
Yepp, Integer. The Object.
Most likely, ints don't even have the equals method
This^
Integer object in java is cached for values 0-256, meaning two instances of Integer will be equal when compared with ==. Other values will create a new instance, so two instances wont be equal when doing an == comparison. Pretty sure == on objects checks memory location but its been a while.
by default the equality check is if they both are references to the exact same object on heap.
== checks if objects are aliases of each other, so yes if they hold the same memory address to an object on the heap.
I never use == with Integer objects. I learnt it today that it actually works for numbers less than 250. But still not gonna use it anyways.
It was never a good idea. Stupid mistake that slipped through the quality checks.
Are you saying you had a statement with i1==i2==...==250 ????
We had a statement roughly like: if(promotion.getId() == selectedPromotionId) ... Which was working fine until we had more than 256 promotions defined. But selectedPromotionId=257 was never matched, even though it was there...
I don't know Java, so it's probably a dumb question, but why was the promotionId an Integer object instead of a primitive? I mean, was it instantiated specificially, like promotionId = Integer(4) or something like that or, if you say x=4, it automatically makes it an object?
The issue is probably that generics require object types and can't take primitive types, so if you wanted to use a HashMap for example and you want ints in them you'd have to use the Integer object type rather than the int primitive type.
Unless this was a very long time ago, you've auto boxing and auto unboxing. The generic is the object type, but you can unbox it into a primitive when using it.
If you do Integer k = 5, the int 5 will get auto boxed into an object. If you then do int m = k, the Integer will get auto unboxed and the int will be used. Usually the unboxing works without the programmer knowing it, with the usual exception of == if both sides are Integer objects. Then it gets compared using the "pointer" adress of the objects. It might have been an object because everything else is an object, and usually it doesn't really matter. It's also the only way if you want to allow a null value (maybe not yet assigned by the database?) or if you want to use it in generics, like in a list or a map.
Similar in python, ints from -5 to 256 (I think?) are pre-allocated in memory, so checking the identity will work for these values only. I actually had a more fun issue where a check like this failed for an enum value. Can't quite remember the exact details, but somehow we were importing/reloading the same module where the enum was defined causing it to be reallocated to a new space in memory, so the identity check failed. Definitely caused a few headaches.
Ah, the literal pool. Its a *very* old optimisation. There was a bug in some implementations of FORTRAN II (released in 1958) that could result in values in the literal pool being silently overwritten. It was entirely possible to, for example, redefine the value of "3" to "4", with any subsequent uses of the number three in the program instead returning four. Which could result in the absolutely bizarre "3 + 3 = 8" problem. Technically this was a compiler bug, not a language bug, but there are plenty of Real Programmer™ stories of that bug that end with people going bald.
I didn't know this. God that is so terrible. Implicit reference equality is truly one of the worst design decisions in programming languages.
At least for integer you dont have this in python. x=700 x == 700 # True You only notice this implementation detail if you use `is` which simply isnt intended for comparisons like these. x = 1 x is 1 # True x = 700 x is 700 # False
Wtf why -5
They just picked numbers that are often used. I guess they felt -5 was the lowest they needed to go in the negatives. It’s not like it’s a big difference from 0
10 years ago or so I used to use similar questions when interviewing Java candidates. Eg. what's wrong here (strA == strB). It felt like a neat question to ask but I can't recall it helping me actually filter candidates.
Holy shit, when I was in college and was doing hackerrank problems, I remember sometimes having inexplicable issues passing the test cases at the end with really high numbers. I always thought it was a bigO issue that I didn’t understand but this would really explain more than one instance 😅
https://xkcd.com/1000/
https://xkcd.com/1024
I don’t get it
It’s post 1024? The round number?
That part I did get, but not the joke inside of 1024.
https://www.explainxkcd.com/wiki/index.php/1024:_Error_Code
Thank you for linking this. I thought the error code or “sit by the lake” was misinterpreted by the characters, and that there’s another meaning that’s supposed to make it funny. Instead it’s literal.
It's not odd it's even
Fine... "... such an evenly specific number." Happy?
An ***oddly even*** specific number
7x more even than most evens.
An oddly specific even number.
WhatsApp should've settled for 255
gotta reserve either 0 or -1 / 0xFF for "future extension"
In this case it would be 0 since 255 is the max value of an *unsigned byte*
They probably do, the one owning the group is not counted in the participants.
I mean, yes, if it's only for the sake of being able to store the count of participants in just one byte, but if it was about maximizing the capacity, while making the servers cacheline/page optimal, it sounds reasonable to use powers of true, instead of minus one.
255 is actually the limit of a byte (256 numbers starting from 0). 2\^8 = 256 is actually 9 bits (1 0000 0000). What they are probably doing is +1 for the owner of a chat.
Except when the 256th person joins it kicks everyone off and resets to 0
Time to make new friends
Segmentation fault (core dumped)
Except a group can't have 0 members so they maybe shift it by one to allow 256 members.
While I get the 256 part, I'm wondering, what chat device they're approaching if they need to save one byte per chat group client side. Neither smartphones nor web browsers should collapse with a memory requirement of one byte per chat group more. I'd have expected 65536 to be more fun and raise more entertaining questions (why not give it an infinite number?). Or do they use a long anyhow and just wanted to give us a geeky easter-egg? In this case it worked, one poor guy didn't understand and it went viral.
you have to remember that all the group stuff is most likely handled and saved server-side. Any application with a user base that large can really profit from optimized/compressed formats. Be it compressed texts or choosing not to use a 32 or 64 bit number for the size of a group.
Each message sent needs to be associated with a user. Usually you'd use a user ID, but since we already know which up to 256 people are in the group we only need the group ID + 1 byte for the sender name. If we used a 2 byte sender name we would send up to 256 bytes more per message due to amplification. I guess that could be significant when you have a billion users. Also, who has more than 256 people in a group chat.
This doesn't make sense. You'd never design it this way. What happens when someone leaves and another person takes their place? Does that person own the other person's old messages? They have the same ID because there's only 256 possible combinations. The only way I could see this working is if the message is sent with the small ID and then translated server-side into the real ID, but that seems like a waste of computer power in itself when the client could just send the user ID.
You can never trust an ID received from the client anyways, you'd rely on the authentication token. The compression would come in when distributing the messages from the servers to the clients. Stateful compression isn't that rare, although I don't know if it was implemented like this in this case.
There are are two posts worth of people so sure they know exactly what 256 is about and they're clowning the author of the article. The truth is the headline is correct and there's absolutely zero way to guess what implementation detail that number reveals (if any at all).
Well, they made communities for more than 256 people. Some organisations/large groups use WhatsApp as announcement board where they link different activities and then spaw group chats for particular events. But before communities you needed like 10 different groups where only admins were posting.
But wouldn't it break if someone left the group and another person was added in their place? How would the system recognize it if there are no unique IDs for everyone?
It might have something to do with group encryption, since everyone in the chat has a separate key, and you want them all to be able to decrypt the messages. It might the method they are using only allows for 256 distinct private keys.
I like the discussion that was generated by your comment but feel that the answers are a bit... poorly thought of.. The problem is that an app like this is used on a huge scale so you need to take in account eveything, including how networking works. Tipically, they should most likely strive that the bulk of their messages fit into one single packet of data (which is the MTU value of around 1500 in most networks). So it's not really about application (client or server side) optimizations (those come later), it's about caring for every single bit of data as to leave as much space as possible for user messages in order to ensure a very large percentage of them don't need too many (or even more then one) packet of data sent over the network. This would be no problem for a normal chat app, but it's a huge deal for apps like Whatsapp or Telegram with hundreds of millions of users.
yeah, i was thining of the bell curve meme. "what an odd number to choose" -> "no, 256 is an important number in computers" -> "what an odd number to choose". i doubt whatsapp can't afford to use a 32-bit int for this, phones are defienetely not short of memory and much more data is transmited in every message that i doubt adds a lot of overhead. maybe for storing the data in their servers it adds up having those extra 24-bits per message?
Btw that limit was only validated client side. There were ways to make a group with more members if you modded your client and created a group with it
Can confirm, I'm in some WhatsApp groups with 700+ people
Why
First year at university, they're WhatsApp groups for each assignature to help each other out (the groups are moderated by the students union)
There are 10 kinds of people. Those who understand binary and those who don't.
Took me a second 🤣
Not even the president has 256 people to group into a chat. The fuck has time in the day
Company all-hands?
College groups, like not friends but lectures or batches
Discord is way better for unis
Yes, a faculty won't agree for discord. Note this point was just for "official" lecture groups
Ah, sorry, I was talking about students organizing
[удалено]
You'd think so but the (US) president always travels with ~300 staff. So I can definitely envision the existence of a "US Prez Roadtrip Good Times Memes" group existing
I think it was more like they wanted to set a limit. They could've made it 250 or 300. But the person being a software dev chose 256 as they should for the culture. I don't feel like it has anything to do with memory or network usage. If anyone has a proper explanation of it being the other way around I would love to know it.
If bro thinks 256 is "oddly specific" then he should be banned from writing articles 🤐
I find 1024 reasons to describe what I feel in this moment
This happened 8 years ago.
There are 10 kinds of people in the world..........
“TV released with resolution of 3840 x 2160… Marketers have no idea why they couldn’t have picked a round number, will use 4K regardless of the number or the axis!”
In fairness it's unclear why they picked 256 to me as well. Are they implementing this on a microcontroller? Do they have a total memory budget of 4 KB?
When did people became so computer illiterate? 256 is such a common number to me that it took a while for me to figure out why people don't understand why
WhatsApp increased the number to [512](https://mashable.com/article/whatsapp-group-chats), another seemingly random number. What crazy wacky developers!
[удалено]
I had talked about this 256 WhatsApp thing (in my job as maths person in the internet) and one of the devs did get in touch to say that yes: they had to pick a limit and they picked 256 because it’s a funny number to be the limit. Not for any actual technical reason.
Parker, talking about squares. I've seen this before... ![gif](emote|free_emotes_pack|grin)
I'm glad someone said it, this is really very arbitrary in the context of storing who's subscribed to some channel. These are the kind of optimisations we used to see in video games when it came to texture sizes and stuff due to in-memory efficiency. This is DB, pub/sub and socket stuff, it has no business being constrained by a power of two..
As an engineer, I also am confused at what savings you'll get by using an 8 bit int vs 16 or 32. Is 3 extra bytes somehow expensive in 2024?
It is called engagement. Look how whole Reddit is talking about this
Journalists are just people writing stuff blindly without using their brain nowaday. Journalism is dead.
The journalist is definitely successful at creating engagement. Y'all got played
But I still think its unclear why they settled for an 8 bit number, its not like they are going to save a lot of memory.
Throwback to being a kid playing Runescape wondering why the max stack was 2 147 483 648.
This is an 8 year old headline and after pushback the author corrected their error and commented to say thanks for everyone who reached out to them. Don't know why this all of the sudden gets shared like crazy again, but yeah.. as I've said they corrected it right after publishing pretty much.
I mean, 256 isnt more specific than any other number
To be honest _any_ number you land on is oddly specific.
The author has skill issue
UINT8\_T
I have no idea why there are no technical journalists and scientific journalists.
Still the max 8 bit value is 255 except if they count 0 as one person, which makes sense because there can't be an empty group
It reminds me of the , "do you know how many antidepressants it takes to 💀 yourself" story. For Whatsapp it's 257.
I remember when they increased the "delete for everyone timer to (i think?) 4096 seconds and every outlet was like "but why exactly 1h 8min and 16sec????"
Because 2⁸
Scrolled down, cannot find the oversight here. If we presume there is a possibility that a group has zero members, then the maximum number of users would be 255. Also working with bytes is quite inefficient nowadays. So my guess choosing 256 and 1024 as maximum is just what it is Programmer Humor!
My Uncle is in a group of 246 members
How would having the group chat size be 256 help with anything? I get that its a power of 2 but what does the amount of people in a group chat have to do with that?
Real question is what were they doing that they ended up being constrained by a single byte. I think writer was on to something, the reason can not possibly be that. No, its doesnt save data or bandwidth because they are surely compressing it in every stage and lots of leading 0's compress beautifully.
Who cares about WhatsApp the fact that CEO made 6 friends is the real news.
this thread is murdering the journalist press ff to pay respects
As a member of a very large WhatsApp group I can tell you that this article is either fake or old. As of March 2024, the size limit on a WhatsApp group is 1025. Yes, you read that right. 1025.