13

The student assistant gave me a half point penalty for writing down to much comments! Direct translation:
To much of this kind of comments is not needed, the code itself is clear on its own.

Comments
  • 0
    That certain comment is useful. IMO, though, the one below that you could do without.

    Basically, your comment is "prints blablabla" while the method is called "printBlablabla"
  • 3
    It depends what it says to be honest. I did know someone who used to do this:

    // requests bills
    requestBills(...) { ... }

    // draw chart
    drawChart (...) { ... }

    // add numbers together
    addNumbers (...) { ... }

    In a case like this, I agree with the assistant. There is no need to have a comment explaining the name of the function.

    Comments should be meaningful and used to explain business logic that is not immediately clear when looking at it.

    You’d have to translate the comments and the function names for us lol
  • 0
    I've wrote the comment: When the user anwsers the giving question with the wrong anwser, a question about culture will be asked.

    I've add this comment just before the else to explain what the else clause is doing.
  • 1
    Comments are fucking lies.
  • 2
    Keep your comments to yourself
  • 2
    People saying comments are always good are fucking idiots. Sorry, but that’s how it is. If your code is clear enough there is no reason for any comments.

    What you’re doing with a comment that is explaining what the code does is duplicating information. And some day that information will lie, because you will change the code but forget the comment. Then you’ll have a lying comment. That lying comment might confuse someone in the future and may even cause bugs.

    So stop writing stupid comments!! Spend a bit more time writing good code. The only time a comment is valid is when it’s explaining WHY something is written in a certain way. Maybe there’s a weird business rule forcing you to do this thing? Then a comment is valid. God I hate comments.
  • 3
    //set x to 0
    int x = 0;

    is almost as annoying and noisy as

    int x = 0;
    int x = 0;
  • 1
    `print0plossingenKwadratischeVergelijking(a,b,c)`

    What the crap?
    I would subtract a point just for that.
  • 0
    @Ashkin it's literally
    printSolutionsQuadraticEquation(a,b,c) with the comment above it saying
    #prints the solutions of the quadratic equation.
  • 1
    @Tobyvw
    Facepalm.
    Unnecessary comment and way too long function name.
  • 0
    Rant feed share this article with us it has some codes that were over this among formation that was used while making software. I need to have some more at this that was at https://my-assignment.help/ this was the site that have all codes among the all language that was useful to have some formats over these.
  • 0
    Wow I really like this recipe, it looks very special but can still be done. I will visit your blog more to read other articles. Happy!
    http://superfighters2.net/
Add Comment