Scroll back to the top

Best comments for source code

[ programming ]

We write source code and the comments for better understanding the ideas and patterns used. It needs to just writing, but the reading the comments, as well. Ideally, you should write the code, then leave it for some time to jump out of the context. Next step is to read it one more time.

If you spent just little time to understand it, then you are lucky to have correct coding patterns and style guides. So, you don’t need to put anything extra like comments.

On the other hand, if you are thinking about some function or even variable usage/purpose, then it needs to add extra comments to help/speed up the understanding process.

Happy coding!