As a software engineer: actually there is no need for a number of people as a power of 2 unless you need exactly 1 byte to store such information which sounds ridiculous for the size of Whatsapp
Or some binary search tree with an artificial height lol.
It’d make sense at protocol level. Otherwise, yeah, even bit-size database columns end up being stored as a word unless the engine compacts it.
evenly specific
A lot of things arbitrarily limit what they can do to more “human friendly” numbers.
I remember being puzzled by this and many other numbers that kept cropping up. 32, 64, 128, 256, 1024, 2048… Why do programmers and electronic engineers hate round numbers? The other set of numbers that was mysterious was timber and sheet materials. They cut them to 1220 x 2440mm and thicknesses of 18 and 25mm. Are programmers and the timber merchants part of some diabolical conspiracy?
Powers of two are the roundest of numbers.
They’re not round, they’re square!
Much later in my career I came to appreciate the beauty of this system and the link with hexadecimal. I had to debug a network transmitted CRC that was endian flipped and in that process learned that in the Galois Field of two, 1+1=0 which feels delightfully nonsensical to a luddite.
They just do it to look cool in front of their developer friends.
Pretty much this…
Once upon a time, sure, you might have used an 8 bit char to store an array index and incur a 256 limit for actual reasons…
But nowadays, you do it because 256 is a “cool techy limit”. Developers are almost all dealing with at least 32 bit values, and the actual constraints driving smaller values generally have nothing to do with some power of two limitation.
Timber is actually cut in inches. That’s why the odd numbers.
32, 64, 128 etc. are all round numbers, counting in binary. They are powers of two. Since computers work in binary, they make logical sense.
1220mm is 4ft, and 18 and 25mm are three-quarters of an inch, and an inch respectively.
They were making a joke. That being said, im not familiar with lumber or imperial<->metric conversions so their second point was lost on me, so thanks.
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.
Lol, weird way to say that 256 is a power of two, and computers operate in base two.
Their definition is a lot better.
It’s a pretty succinct explanation that links what it is to something most people have heard of (a byte).
It used to be a way bigger deal when computers were very memory scarce, if you needed to say, represent 1024 values, that means you’d use 10 bits or 2 bytes, the remaining 6 bits could be used to store other related information like flags but more often than not it would be waste (unused values that still have to be represented as 0s)
These numbers are pretty arbitrary nowadays but they still show up a lot in computing. They didn’t choose 256 so they could represent it in a byte, the real reason is probably that groups larger than 256 can’t realistically be managed by users.
That’s my 2¢ anyways.
Tbf saying it that way brings a visual metaphor. Simply giving it as a mathematical definition would leave it feeling just as arbitrary.
I remember thinking something similar when I was a kid modding Starcraft. Max levels/ranks in researching was 256 and I always wondered why such a weirdly specific number.
Shout out to Castlevania II, where you can hold anywhere from 0 to 256 laurels. Yes, you read that right – 256, not 255. I inspected RAM to double check. It’s a 16-bit word on an 8-bit system with a maximum value of
0x100
. They could have used 8 bits instead of 16. But no, they really did choose this arbitrary number.how can you hold 0 laurels? that’s different from not having laurels?
the number of laurels in your inventory is stored as an integer from 0 to 256.
I hate this. I love this.
If I ever make a game I might put stuff like this in it.
“I inspected RAM to double check.”
That’s an unhinged level of commitment. Respect — I dig it
Read it in the (old) avgn voice…
Sounds like such a flex move
Maybe they keep some other data in the same space using bitmask?
Even if true, 256 would be a waste of the range. 255 would make sense if trying to stay in one byte, using a whole different data type to get one extra bit just to hold 256 instead of saying “screw it, let’s go to 511” even while using other bits.
It’s just a very weird thing to do to pick 256 as a value limit back in those days (also oddly specific now, but for different reasons)
plausible, but my experience from dissecting these kinds of games is that they tend not to be as space efficient as you’d think they could be if they were the kaze emanuar type. The fact that they opted to have 257 distinct values for the laurels suggests to me that they weren’t prioritizing space efficiency.
My best (wildly speculative) guess is that a designer, knowing 256 is a common limit, wasn’t thinking carefully and said the maximum value should be 256 (instead of 255), and then an overly pedantic coder implemented this to the letter while rolling their eyes.
Currently in the industry - it’s exactly this. It’s a communication issue between the programming team and other teams, where designers freely speak for design, artists freely speak for art, etc. but it’s much harder for programmers to speak for implementation since it’s usually in reference to somebody else’s work, and when designers get offended or defensive or dismissive of the non-designer requesting 256 be changed to 255, then it stops being worth it.
For example, we made an absolutely mint UI backend, it was data driven with editors so anyone could whip up a new UI for the next feature without needing programmers. The design team were like “damn, I hear how complicated this thing was to build, so let’s make the programmers lives easier by not using it and only asking for simple bespoke stuff”. Telling them “the investment has already been paid for so please use it” was tantamount to telling them how to do their job while being ungrateful they had considered us, furthering the communication breakdown.
Yes I’m bitter and tired. It’s easier to use a short for 256 instead of arguing to have my opinion considered
It also has the second best NES soundtrack, after The Guardian Legend.
In the top ten, with Blaster Master, and Batman.
I’ve never given TGL a proper listen, though I have the game for NES. Thanks for the recommendation!
That’s a super old article as well.
They got rightfully roasted in the comments for not knowing even the most basic things about computing.
Still odd, I very much doubt they use a 8bit variant to set this limit. What would this bring ?
When the program is running it’s probably stored with 32 or 64 bits, but that probably isn’t the case for the network packet layout. I can imagine them wanting to optimize network traffic with over 3 billion users even if it’s just a small improvement.
Also TIL that Erlang’s VM apparently stores strings as linked lists of chars. Very strange.
Still odd
Actually, it’s even.
Numbers guy here, I can confirm 256 is an evenly specific number, and not an oddly specific number.
User name checks out
But is it Numberwang, Mr. Numbers Guy?
As the numbers guy. Do you remember the name of the site that can tell you the what a given number is often associated with?
My brain is going to OEIS or angel numbers which are both like total opposites. Number theory or numerology, take your pick.
Wikipedia often has disambiguation pages for numbers that may be helpful in a search like this (https://en.m.wikipedia.org/wiki/71).
WolframAlpha is good for identifying numerical properties of numbers (https://www.wolframalpha.com/input?i=71).
OEIS has a searchable set of sequences (https://oeis.org/search?q=71&language=english&go=Search)
I fear that none of these is what you’re looking for, though. My attempts to find something that sounds like what you want mostly turned up resources on numerology, and at least one article apparently about how the meaning of numbers is radically different between cultures.
No that doesn’t seem to be it. Thanks for trying anyway.
Oh you are the numbers guy ? Name every number
I’m going for the boring but practical answer: x and x . Obviously the second set is doing the heavy lifting.
You should know your limits
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Oh yeah well if you’re some sort of numbers guy, answer me this: I think you’re name is super cool, and makes me wonder, is there a largest prime you can make listing digits of pi starting from the beginning. There’s gotta be infinite right?
Pi is suspected to be a normal number (though this has not been proven). If it is normal, it’s likely that integers comprised of the first N digits of pi will be just as likely to be prime as comparable large integers. I suspect but cannot prove that there are infinitely many prime numbers whose digits are the first N digits of pi (with or without the leading 3).
Well, three is prime and pi starts with a three, therefore, even if there’s larger primes, there is one which is the largest. QED.
Unless there isn’t one that’s the largest because there are infinite primes.
You started at zero and went to infinity. If you start at infinity and go to zero then the first prime you got is the largest. QED.
I can no longer tell if these are bits. 🫠
(Yes, this is a bit. 💜)
nerd
Ha, got eem
What’s app starting from 1 the scrubs
Depends on how they handle groups with 0 members, if they just get deleted once the last person leaves, you shouldn’t run into issues
Like memory in bits maybe, so 64 128 256 512 1024 2028
Since people are binary like the great Orange says, they have to use a power of 2?
Wouldn’t max value for 8 bit (unsigned) integer be 255? Like the number has 256 distinct values, but that includes 0.
Computers start counting at zero, (unless it’s python) so the first person in the group would be ID 0, the second person would be ID 1
At a basic level python normally counts from zero (indices as an example)
You’re thinking of the highest integer number, not the “number of numbers” - which is 256, from 0 to 255, and thus 256 possible users in a group chat.
The number of distinct values are what matters.
Right but having a group chat of size 0 isn’t very useful.
Not to be snarky, in programming there’s rarely (in situations like this) a reason to keep count. Computers are exceptionally good at counting integers so they’d just count individual client id’s (however they’ve implemented that system), not keeping toll on how many clients are in a group chat.
So one client, be it at position zero is a one client group. Add another client at position one and you have two clients and a two person group.
I don’t think it’s the variable for counting the number of us in a group that’s the issue here. There’ll be some internal tracker that gives everyone in the chat group a local ID probably for the purposes of ensuring that everyone stays in sync.
If you leave the group and then go into a different chat group you’ll probably have a different number in that group because the internal counter is specific to the chat, not to the user ID which will be a unique ID used across all interactions for that phone number.
What would 0 represent then?
False.
The limit isn’t on the actual count of people, it’s likely the size of the chat user id number.
one person, and 255 would represent 256 people
The first index
And programmers usually start counting at 0.
Your thinking indexing, 0 is still 0 when counting.
If this is about a counter for users in the chat, sure. But if this is an array of users indexed by an 8-bit number, then it will fit 256 slots with the first slot being numbered 0.
this guy indexes
Fair, sounds reasonable
I’m typing this on a 64 bit device. Why anyone would limit something to an 8 bit number in 2025 is really odd.
I get what you’re saying but I don’t like this line of thinking. In the tech industry there is far too much bloat that we just accept due to cheap memory and storage.
There’s much better algorithmic and datatype optimizations to be made than to design your app around saving 3 bytes that most runtimes probably represent as a long long anyways
True but more generally things like Electron apps, not precompiling classes in interpreted languages’ Docker images, looping through millions of records without plucking only the data you need, etc seem to be widespread and shrugged off.
While writing code you can get in the habit of doing things efficiently and long-term the cost savings pile up. Obviously caring about only this one specific case will hardly accomplish much on its own.
Whatsapp has 2 billion users.
The difference is 16 billion bits compared to 128 billion bits, or about 16 GB and that is just for the number.
When working with big sizes, memory optimization is key.
It’s for their servers. I guess it might have to do with cache optimization reasons. For performance reasons, they want to ensure they can fit as much as possible in the cache. One extra byte can throw the memory alignment off, which cause wasted space in cache.
Just my guess. There might be other reasons.
A single username will use up more memory than an 8-bit limitation to the number of users will save.
On a device with many gigabytes of RAM and probably terabytes of storage.
I guess when you have billions of users, and presumably tens or hundreds of billions of instances of a thing living in your sever every bit adds up? I don’t even know where to even start doing the napkin math for something like that.
100 billion messages per day and over half of them in groups apparently. It’s a lot, but 3 bytes per message is still not a lot of data. I’d guess they pack the metadata as tight as possible.