• jsomae@lemmy.ml
    link
    fedilink
    English
    arrow-up
    20
    ·
    2 hours ago

    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.

      • jsomae@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 hour ago

        I’ve never given TGL a proper listen, though I have the game for NES. Thanks for the recommendation!

      • jsomae@lemmy.ml
        link
        fedilink
        English
        arrow-up
        5
        ·
        1 hour ago

        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.

  • ObsidianZed@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 hour ago

    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.

  • Echo Dot@feddit.uk
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 hours ago

    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.

  • Synapse@lemmy.world
    link
    fedilink
    English
    arrow-up
    17
    arrow-down
    1
    ·
    edit-2
    2 hours ago

    Still odd, I very much doubt they use a 8bit variable to set this limit. What would this bring ?

    • Krzd@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 hours ago

      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

    • deltapi@lemmy.world
      link
      fedilink
      English
      arrow-up
      45
      arrow-down
      1
      ·
      5 hours ago

      No, you can’t have a group of zero, so the counter doesn’t need to waste a position counting zero.

      • HereIAm@lemmy.world
        link
        fedilink
        English
        arrow-up
        11
        ·
        5 hours ago

        If you ever create a system where the number of users is “group.members - 1” everywhere in the code, I’d be very disappointed in you and deny that PR.

        On another note; I doubt WhatsApp are so concerned with performance they are actually limiting the number of group members by the data type.

        • BillBurBaggins@lemmy.world
          link
          fedilink
          English
          arrow-up
          8
          ·
          4 hours ago

          But it wouldn’t be like that though would it. It would be public group.members() and the u8 would be private.

          If all the millions of groups are saved on a central database then making the size a u8 isn’t really that weird

          • HereIAm@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            2 hours ago

            I hadn’t thought about it on their server side tbf. But the more i think about it maybe there are other compounding reasons to keep group sizes small, such as the exponential number of links in a growing network and such. But, that is all beyond my knowledge area.

  • 18107@aussie.zone
    link
    fedilink
    English
    arrow-up
    53
    arrow-down
    5
    ·
    8 hours ago

    In this case the limit was entirely arbitrary.

    The programmers were told to pick a limit and they liked 256. There are issues with having a large number of people in a group, but it wasn’t a hardware limit for this particular case.

  • Mr. Satan@lemmy.zip
    link
    fedilink
    English
    arrow-up
    16
    ·
    edit-2
    8 hours ago

    Wouldn’t max value for 8 bit (unsigned) integer be 255? Like the number has 256 distinct values, but that includes 0.

    • Alaknár@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      6
      ·
      2 hours ago

      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.

    • Echo Dot@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 hours ago

      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

    • squaresinger@lemmy.world
      link
      fedilink
      English
      arrow-up
      28
      ·
      5 hours ago

      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.

      • khapyman@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        12
        ·
        8 hours ago

        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.

        • Echo Dot@feddit.uk
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 hours ago

          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.

  • Chozo@fedia.io
    link
    fedilink
    arrow-up
    139
    arrow-down
    4
    ·
    12 hours ago

    Source.

    This isn’t a “tech article”, it’s an article about tech. This is a normie article from a normie news outlet for normie readers.

    Also from the article:

    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. DB

    • AFK BRB Chocolate (CA version)@lemmy.ca
      link
      fedilink
      English
      arrow-up
      8
      ·
      3 hours ago

      That quote really is the problematic part. The part about switches is fine - it’s an attempt to explain tech to a “normie.” But for a tech writer to ever say it’s not clear why they settled on 256 is worse than embarrassing. They had to be corrected by tweets.

      Anyone whose ever had an intro to computers class has had a computing professional explain computers using simple language and analogies. That’s the way this kind of thing should work. It sounds like this author has no more clue about computing than the target audience, which isn’t going to work out well for the reader.

    • AlexanderTheDead@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      4 hours ago

      It doesn’t really matter that it’s a “normie article for normie readers”. Writing articles is journalism. Not knowing 256 offhand? Permissible. Being a journalist who wrote an article and didn’t even do the bare bones of research? You’re still a bad journalist, and as callous as it is, you should lose your job and livelihood. Bad journalism is too dangerous to just let it fester like this.

      • Echo Dot@feddit.uk
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 hours ago

        The newspaper he was writing for is a major publication he absolutely could have asked someone.

        The problem here is the newspaper didn’t care enough about the article to put anyone on it who is even remotely familiar with technology. They probably thought of it as just some throwaway piece to fill out a bit of space. Which to be fair it would have been had it not been for that comment.

    • markz@suppo.fi
      link
      fedilink
      English
      arrow-up
      61
      arrow-down
      1
      ·
      7 hours ago

      That weird ass explanation with switches and “one of the most important numbers” still sounds absolutely clueless.

      • wabasso@lemmy.ca
        link
        fedilink
        English
        arrow-up
        7
        ·
        edit-2
        4 hours ago

        I liked the switches analogy! Generally about binary though; I agree it doesn’t connect back to the number of users application.

        And yeah most important number…sounds like they were quoting an LLM.

    • wuzzlewoggle@feddit.org
      link
      fedilink
      English
      arrow-up
      48
      arrow-down
      5
      ·
      10 hours ago

      One of the most important numbers? I’d argue the most important number in computing is either 1 or 0…

  • xeekei@lemmy.zip
    link
    fedilink
    English
    arrow-up
    74
    arrow-down
    1
    ·
    11 hours ago

    You know you’re a tech nerd when 256 sounds more even than 250 or 300. 😅