Linear code is more readable - eviltoast
  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    28
    arrow-down
    1
    ·
    1 year ago

    Exactly, the code on the right let us read only what matters when we’re trying to solve a problem or understand it. The left one makes us read the whole thing and treats code like prose instead of reference material.

    • tatterdemalion@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      And this is actually important when doing your job. I was reading code just yesterday written like the “left side” and it slowed me down because I was forced to understand everything that was happening in a big paragraph instead of just glossing over a function with an understandable name. These “inline functions” will often introduce temporary variables and stuff that forces the reader to understand the scope of things that really don’t matter at the current level of abstraction.