• @dustyData@lemmy.world
    link
    fedilink
    English
    571 year ago

    As a professor said, most programming languages don’t care about readability and whitespace. But we care because humans need it to parse meaning. Thus, write code for people, not for the machine. Always assume that someone with no knowledge of the context will have to debug it, and be kind to them. Because that someone might be you in six months when you have completely forgotten how the code works.

    • @zalgotext@sh.itjust.works
      link
      fedilink
      English
      161 year ago

      Exactly. You read code way more times than you write it, so it makes all the sense in the world to prioritize readability.

    • rockerface 🇺🇦
      link
      fedilink
      English
      6
      edit-2
      1 year ago

      Yep, if you’re writing code for a machine, just do it in binary to save compilation time (/s just in case). Also, you in six months will indeed be someone with no knowledge of the context. And every piece of code you think you write for one-time use is guaranteed to be reused every day for the next 5 years

    • @snowsuit2654@lemmy.blahaj.zone
      link
      fedilink
      English
      21 year ago

      Yeah I totally agree. You can minimize and optimize as part of your build procedure/compilation but the source code should be as readable as possible for humans.