• Ottomateeverything@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    I had a programmer lead who rejected any and all code with comments “because I like clean code. If it’s not in the git log, it’s not a comment.”

    Pretty sure I would quit on the spot. Clearly doesn’t understand “clean” code, nor how people are going to interface with code, or git for that matter. Even if you write a book for each commit, that would be so hard to track down relevant info.

    • mkwt@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      Yeah, I think that guy only got a superficial understanding of what Uncle Bob was saying.

      My policy as a tech lead is this: In an ideal world, you don’t need the comment because the names and the flow are good. But when you do need the comments, you usually really need those comments. Anything that’s surprising, unusual, or possibly difficult to understand gets comments. Because sometimes the world is not ideal, and we don’t have the time or energy to fully express our ideas clearly in code.

      My policy on SCM logs is that they should be geared more towards why this commit is going in, not what is being done. And what other tickets, stories, bugs it relates to.

      • bleistift2@feddit.de
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 months ago

        But when you do need the comments, you usually really need those comments.

        It’s nice to see you sharing my experience. My code is either uncommented or very severely commented with comment-to-code ratios of 10:1 or more. I hate the files that are soo green… :(