15
YADU
4y

"Our code is self-documenting, we dont need comments" my fucking ass hole.

Comments
  • 1
    My ass is dirty and you need to tell me how to clean it. I made a meeting for you, see you as 3pm!
  • 3
    The truth about comments is that they are code run by developers. They are as hard to write as the actual software run by CPUs - expect that devs are better at writing for machines than writing for humans - so writing actually helpful comments might be even harder than writing the computer code...

    No time -> no (or worse: Shitty, misleading, and outdated) comments.
    If there are deadlines, there are no comments (or tests, or good architecture, or anything else that goes beyond making it somewhat work for the basic business case...).
    That writing code (or any complex text really) has a non-deterministic time cost doesn't make it better either...
  • 3
    @Oktokolo I agree good comments are hard to write, but just say that you don't want to put in the time/effort to comment your code instead of pretending you're some fucking saint that writes completely clear code unlike the rest of us fucking mortals.
  • 1
    @YADU
    Humans don't like to look like they aren't able to keep up with demands. Humans are also pretty good at coming up with justifications that make them not look like they aren't able to keep up with demands...

    Maybe the dev in question is just a human.
  • 2
    @Oktokolo Good comments shouldn't transcribe the what but rather the why
  • 3
    @12bitfloat thank you

    My coworker recently ran into a windows bug, and needed an ugly workaround. So he commented a description of the bug plus a few relevant links.

    There's no "clean code" that will make up for this kind of comment.
  • 3
    @12bitfloat
    Exactly. That is one of the core reasons for them to be as hard to write as the actual code. You have to switch from telling a machine what to do, to telling a human why you decided that that is what needs to be done and why that way of doing it has been chosen.
    Writing documentation is its own skill set. And people that got into development because they didn't want to deal with other people are normally especially bad at it.
    I guess, pair programming ironically is for some teams the only way to get good comments into the code base.
  • 5
    @Oktokolo I tend to use comments when the real world part is complicated.

    There's no need to document a controller which creates/updates/archives webshop products, because most devs have seen a million similar pieces of code.

    But a payroll system which deals with taxes, pensions, insurances, expenses, overwork adjustments, rebates, etc — most developers aren't labor law experts, and human laws can be super strange and illogical.

    So that's when my comment-to-code ratio increases, to explain why taxes are applied in a certain order, or why certain values depend on which EU country the employer is registered in, etc
Add Comment