56
RYPTAR
7y

Stop bitching about having to write comments, they are important whether you like it or not. Trust me nobodys code is "that good" 😒

Comments
  • 3
    I'm sorry but when I've got a hello world script with three lines im not going to comment that 😆
  • 0
    I don't believe my code is "that good" but it's all basic operations. I expect that if I'm in a named controller, say an Order controller in a method called "add_product" and I create a line item record with the product associated to it and the add that to an order and provide a render declaration to wrap it up. I expect any reasonable engineer to get the why and How from that. The problem is that some people put 100 services and providers and strategies on top of this incredibly simple flow to do the exact same thing and then still refuse to comment the reasoning behind the massive indirection. This is the problem. The real answer is "write clearer code, but when you don't explain WTF is happening"
  • 1
    Yeah?
    I add comments to my code but the guy doing my code review invariably deletes them 😕 because "we don't need that"
  • 1
    You don't need comments to describe what the next line of code does, each line should be simple enough to be self explanatory. But you DO need comments to describe sections of code, algorithms and basically any method, class or module, saying what it does, why it is needed, how to use it, what it expects and any possible side effect. It's basic common sense. Yes, you could read all the code, think about it and then figure all that our by yourself, but it's about 1000x faster to read the comment!
Add Comment