• potustheplant@feddit.nl
    link
    fedilink
    arrow-up
    14
    arrow-down
    1
    ·
    3 months ago

    Hard disagree. It’s a lot easier and faster to understand a function that is prefaced with a small line of text explaining what it does rather than trying to figure it out yourself.

    It’s not about whether you can understand the code or not, it’s about efficiency and clarity.

    • Aurelius@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      3 months ago

      Yeah, just 15 seconds and jot down a comment. Whenever I’m even hesitant, I just leave a comment. Doesn’t hurt anything and it can always be removed if not needed

      Easier to remove later rather than add it after the fact

    • weststadtgesicht@discuss.tchncs.de
      link
      fedilink
      arrow-up
      3
      arrow-down
      4
      ·
      3 months ago

      If done right, the “what it does” is in the method name. If your method is too complicated to summarize in its name, chances are good you should split it up or extract parts of it.