• Quetzalcutlass@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    ·
    edit-2
    1 day ago

    Bitwise operations are elegant in the same way nunchucks are elegant: they are impressive and versatile in the hands of a master, but inflict a lot of self-imposed bruises in the hands of novices.

    • robojeb@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      1 day ago

      Even in the hands of experts they can be dangerous. One of the most respected programmers at my company wrote an implementation of memory that had an off by one error when bit indexing for alignment checking.

      Everything worked fine until you had 16-bit relatively aligned src and dest and happened to be targeting uncached memory.