59

My coworker comments every line of code I think the code is not readable!

Comments
  • 24
    Is he paid by the line? And for a guy that comments that much, he should at least learn to do it properly, i.e. not write a book every single time. It must be direct and clean.

    (Welcome!)
  • 16
    I smell a manager or a PM in your coworker's past, who was probably an annoying busybody, insisting on "full documentation."
  • 5
    I agree. That's just stupid. Also all those nested if-statements and foreach loops. There must be a better way.
  • 6
    I'm all for great documentation but damn that's a weeee but excessive
  • 8
    This almost looks like pseudocode that was left in. When I'm building a process, I will lay out the steps like that.
  • 4
    I have seen similar code, but with a doc-comment above it repeating all those comment-lines with their indentation as a so called "detailed design".
    Needless to say, the code was taken from a previous project and so half of them didn't match up.

    You often get the "one colum for code, one colum for comments"-style from electrical engineers working in software.

    Sometimes it's easier to hide all comments when reading such code.
  • 1
    Lol, wtf did I just see.

    This reminds me an ex-coworker of mine, although he wasn't *that* maniac. (But who knows, maybe it's still him, just more weird.)
  • 1
    Speaking in terms of code quality this looks bad.
  • 9
    ...

    How does he possibly think
    // set variable
    Variable = ...

    Is needed? Oh man thank God for that comment. I was almost confused.
  • 2
    Yeah, comments can easily transform from well thought out provisioning, to horrid repetitions and lies.
  • 2
    Most important question: would you know exactly what that code does without those comments?
  • 1
    Unfortunately I'm the exact opposite.
  • 1
    He should comment only parts that doesn't make sense. API calls, DB calls etc. Apart from that commenting about object properties etc will make the code more unreadable.

    TLDR;
    Code should speak itself.
  • 1
    @segfault0xff yes

    He needlessly describes his "thought process" in places where it isn't necessary

    He basically just writes them in plain English
  • 3
    @Krokoklemme well I wouldn't say it's needless.. it probably was to the original developer, and probably just got left in. It's a fairly common antipattern.
  • 1
    Good code is like a joke if it is good not need explanations. Maybe a general comment would be enough, but comment every line of code is weird.
  • 2
    @MaxCruz if I had a dollar for every time I heard that shitty "joke" I'd have a nice laptop.

    The joke implies no comments necessary and that's just pure bullshit. There's a happy medium between no comments and this atrocity.
  • 1
    @Stuxnet Well, to say: "if I had a dollar for every time ..." is not so original either. It is not necessary that you use vulgarity to validate your opinion.

    My point is that a more declarative and less imperative code style tends to require fewer comments.
  • 1
    Comments are for maintainers not completely familiar with the process they're troubleshooting. Ever try to solve a problem in code that has no comments/documentation? It's a fucking nightmare.
  • 2
    @MaxCruz You're not gonna like this place if you dislike "vulgarity."
  • 0
    As a reviewer I would reject changes.

    Commenting everything increases technical debt a lot - as you need to validate that the actual code is in sync with the comment - and most people do not update comments as they change code.

    But there is a whole lot more wrong here... Eg Nesting conditions instead of making a clear code flow and so on.
  • 0
    Comment or not to comment? You crazies need to make up your mind. I’d rather have that over some garbage that wasn’t commented at all.
  • 0
    It depends... If u ever were completely misled by comments, you would understand I guess.

    It's not nice making a one liner change and fucking up because you read the comments and thought 'trivial'.

    Reading the code instead takes time that you might not have... And lead to shitake as in shit plus bukkake.

    Because you really cannot comprehend how a sane person could have written that code.
Add Comment