54

Junior dev complained about my request to remove unnecessary comments because they're too obvious. "They may be obvious to you, but not to others" he said.

The codes and the comments:
// Sort the array
arr.Sort()

// Return the first element of the array
return arr[0]

Comments
  • 38
    Remove unnecessary junior devs
  • 18
    Jr is right! That shit is confusing!

    I say - thats not enough comments. Reject, and ask jr to double the amount of comments. rinse. repeat, until jr gets the point.

    Maybe jr should wrap the confusing code with descriptive function names? Like: SortTheStupidArray, and GetFirstElementOfArray? then add comments. And that zero... it can be a const!
  • 1
    This would not have happened if you were reviewing the code properly on weekly basis maybe?
  • 5
    @magicMirror this is the answer.

    And when they finally get the message, tell them to go back and remove all unnecessary comments.

    Don't fuck around with jr's, they're dumb as a box of hair and need to be put in their place.

    I'm all for discussions around why a change has to happen, but you do not tell your Sr or lead that you won't do something because you don't like it.

    Don't like to be treated that way? Find another career.
  • 3
    He thinks non-technical product managers read his code.
  • 3
    Ask him to put comments on like

    Start of if, end of if

    Start of function, end of function

    Return // this line return the result

    For loop. // loops through all the elements

    Print_ln // this line prints the line

    Then he will understand.

    Or may be ask him to read a good book about clean coding
  • 1
    @magicMirror this is a nice idea, will ask him to do this, maybe he'll see the problems lol
  • 1
    @lassiecoder we do code review for every PR, usually it requires 1 senior dev approval before it can be merged, but everyone is welcome to share their opinions. We don't have code review sessions with the whole team every week, but when code smell is detected anyone can raise a ticket
  • 1
    @nullcoffee he will enjoy it. Tbf he has only begun working as a dev for a few months, his code comprehension is weak. That's why he wants each line of code to be accompanied by a comment in plain English so he can understand it faster.
  • 3
    @Xamenyap This junior hotshot needs to be put into his place. Tell him that code needs to be written in a way where it should be clear what the code is doing without comments (make sure variables, methods have proper names).

    Now comments are usually added to explain WHY some code was written/executed in a certain way. Its necessary to comment parts which are not obvious, otherwise devs will spend up to few hours sometimes days debugging the whole flow just to figure out WHY something was done in a certain way.
  • 4
    Wait till you see comments in non English language flying in your codebase and have to use Google translate.
  • 0
    Said junior is Dora The Explorer?
  • 1
    This made me giggle
  • 0
    this fucking junior just reported that I "didn't mentor him enough" to my manager! Meanwhile he couldn't accept the most basic feedback!
Add Comment