2
Xoka
4y

One of my clients requested me to add
// comments
in one small project created using ReactJS.
a very small project that just calls a server to send and receive data.
I'm not sure, what I'm gonna comment in the HTML/JSX section :/

Comments
  • 2
    // comments start here
    // make xhr
    // process the output or error
    // comments finish here
  • 1
    No matter what you do, at the top of the file, place a "client forced me to write as many comments as I did", so instead of you being hated, the client is hated by whoever gets that piece of code next.
  • 1
    you should always be commenting your code, no matter how simple. at the very least explain why the code exists and what it does. even 1 sentence will suffice.
  • 1
    @reginsmol
    // Prints the startup message to console
    println(startupMessage);
  • 1
    @reginsmol
    If you can't explain what a function does in an xml comment or and jsdoc comment, your algorithm is in need of refactoring. //Comment //every //line spoon feeding is low value.
  • 3
    @SortOfTested i didn't say comment every line. I said comment your code no matter how simple. Even if its a single liner at the top of the file quickly explaining why the code exists and what it does.
  • 1
    @reginsmol
    Ah, I see where the confusion is coming from.

    There's a read between the lines implied message that we all got from OP, he's definitely not an idiot. This site is effectively dailyWtf with conversation. It's a support group for devs dealing with a higher than average level of abuse/stupidity. If someone is posting something here (with a few notable exceptions), it's because they're venting about having experienced the most ridiculous, oft unnecessary extent of whatever it is they're talking about.

    Given that, the contextually obvious subtext is OP is being asked to apply spoon feeding comments on something barely greater than hello world. We're all on the same page in regards to appropriate documentation, his kvetch is in regards to needless excess. We've all had the shitty pedantic PRs and can sympathize. We then in turn make light of the problem to help OP vent.

    This is the way 😋
Add Comment