oddly specific
-
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?
-
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
-
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.
-
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.
-
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)
-
Powers of two are the roundest of numbers.
They're not round, they're square!
-
ITT: People who have never done low level networking.
Edit: Without some absolutely crazy hacks, the smallest amount of data you can really transfer or compute on is one byte. 256 requires one byte, 257 requires you to DOUBLE the data used to 2 bytes. Multiply this by whatever data they send and the problem remains the same.
This is the kind of thing that comes up a lot designing custom protocols.
My experience is that a limit of 256 means they probably are willing to allocate up to 24 bits to send the value over the network:
0x323536
People seem to love to pass around their numbers as JSON or similar.
-
They're not round, they're square!
Only every other one...
-
Numbers guy here, I can confirm 256 is an evenly specific number, and not an oddly specific number.
But is it Numberwang, Mr. Numbers Guy?
-
They're not round, they're square!
Slow Clap
Well done! -
This post did not contain any content.
evenly specific
-
I can no longer tell if these are bits. π«
(Yes, this is a bit.
)
-
(Yes, this is a bit.
)
wrote last edited by [email protected](Thank you for the kindness of clarity
οΈ
I may now be at peace.) -
I can no longer tell if these are bits. π«
That's what she said...
-
That weird ass explanation with switches and "one of the most important numbers" still sounds absolutely clueless.
Still, it works well for "normies"...
-
Numbers guy here, I can confirm 256 is an evenly specific number, and not an oddly specific number.
User name checks out
-
This post did not contain any content.
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
-
this guy indexes
Unless it's lua, then screw anyone programming with it.
Have to use lua for my current project and the 1-based indexing is really screwing with me.
-
I hate this. I love this.
If I ever make a game I might put stuff like this in it.
Having made a few games back in the day, this isn't something you add on purpose, this is something that you screwed up, are going to "fix later", then realize it's too much hassle to rewrite 45% of your code and you just raise the minimum spec requirements a bit to compensate.
-
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
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.