▲ | cncjchsue7 9 days ago | |
This sounds like hell to me. Not everything is complicated, most functions don't need comments, why require it? Just fix complexity when it arises. Don't mandate that you can't make any complexity. | ||
▲ | bornfreddy 9 days ago | parent | next [-] | |
Agreed. If you need a comment to tell you what the function does, you should think deep about naming, and if this fails, consider if this is the correct abstraction. Comments are a way to kick the can down the road - "I was unable to make this code clear enough, so here is the hint to help you". Edit: sometimes the comments are the best of all evils, and you should use them to explain the constraints that led to this code - they just shouldn't be mandatory. | ||
▲ | cco 9 days ago | parent | prev [-] | |
What is a function supposed to do and why? |