this post was submitted on 03 May 2024
400 points (95.0% liked)

Technology

59534 readers
3195 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] barsoap@lemm.ee 2 points 6 months ago

It could only fit 10 messages before it’d run out of space, and once full no messages would be received at all.

You often hear programmers cite zero, one, infinity but fact of the matter is... while most if not all of your code should be capable of that, be blissfully ignorant about any imposed limit because it's going to work whatever you set it to, the application often still should have a limit:

Even if you're not as ludicrously storage-constrained as those old Nokia bricks the data structure you're storing it in is going to have some kind of assumptions about up to what number of elements it's going to be efficient, so in e.g. game programming you write your code, document your assumption in the form of an error or warning thrown if that limit is exceeded, and when the level designers break it you have a look together at the thing and decide whether the limit needs increasing, or the level designers should reign in their use of whatever thingummy is breaking the limit.

Not to mention that just storing an index for an arbitrarily large data structure can take up arbitrary amounts of RAM. Do you really expect me to use variable-sized numbers just so that you can have more than 2^64^ (~1.84×10^19^) messages. Or columns in your spreadsheet, or whatnot.