• Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    single use functions are fine; I often break 20+ line functions apart and it makes it easier to test and reason about, it’s not just to avoid comments: block comments are just a sign that the function might be getting too complex.

    • bitcrafter@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      On the other hand, I often have wished that the author of the code I am reading had just kept their original 20 line function around instead of splitting it up into a zillion little functions that force me to constantly jump around to figure out what is actually going on.