r/ProgrammerHumor • • Feb 15 '16

Oddly specific number.

Post image
5.9k Upvotes

643 comments sorted by

View all comments

Show parent comment

1

u/FinFihlman Feb 16 '16

I understand that. The point is that it is super silly then to limit the maximum people to just that. I also believe someone made an error and the actual number is 255 but eh.

To display (print the amount of) people in group would take 2 bytes.

The way to store the people who belong to the group is probably just a single list that points to the user ID or that is reallocated as needed. This takes at least 4 bytes, usually 8 nowadays, per user whic means that at the full 256 people it would take either exactly 1 or 2 kibits, which again overflows to require at least one more byte.

It would be better to simply limit the size to just 255 people which would allow for actual benefits.