Comments make the code easier to read, but most of the comments are quite obvious π€¦ββοΈ
Ex: the function βfetch_urlβ - fetches the URL.
Here are a few pointers around writing 10x better comments πβ
- mention what the function does in a line or two
- mention the assumptions made in the business logic
- mention any external services that the function is relying on
- mention known todos referencing the associated ticket
- mention how your logic is using an algorithm or data structures
- mention the parameters, their types, and sample values
- mention an example usage of the function
Every single function need not be commented on in such an exhaustive way, but the critical functions cannot afford to have blind spots.
β‘ I keep writing and sharing these engineering nuggets, so if you are keen on learning them, follow along.