• Miaou
    link
    fedilink
    arrow-up
    4
    ·
    4 months ago

    Hard disagree on your first point. Name the flags with descriptive name, move this initialisation to a function, and there you go, self-documented and clear code.

    • AdNecrias@lemmy.pt
      link
      fedilink
      arrow-up
      3
      ·
      4 months ago

      I’m with you but sometimes you don’t have the chance in low level. Max you can do is create local variables just so the bits you’re XORing are more obvious. And whenever you’re working with something where that’d be wasteful and the compiler doesn’t rid if it, you’re better off with comments (which you need to maintain, ugh)

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      4 months ago

      Hmm, maybe my opinion is just shit in that regard. I don’t code terribly much low-level, so I’m probably overestimating the complexity and underestimating the options for cleaning things up.
      That was kind of just a random example, I felt like there were many more cases where low-level code is complex, but I’m probably basing this off of shitty low-level code and forgetting that shitty high-level code isn’t exactly a rarity either.