• @[email protected]
    link
    fedilink
    English
    2421 days ago

    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?

    • @[email protected]
      link
      fedilink
      English
      1721 days ago

      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.

      • @[email protected]
        link
        fedilink
        English
        1321 days ago

        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.

      • @[email protected]
        link
        fedilink
        English
        321 days ago

        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.

      • @[email protected]
        link
        fedilink
        English
        220 days ago

        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.