Comments are a crucial part of software development (though some people think they are not). However, when you try to understand code, just going through the code won't illuminate the decision-making process. One of the best-attached documents that describe the decisions made in the code are comments.
In one case, I read the comments to understand the use cases and limits around a feature in the dict and set implementations in Python. Both codes are enriched with comments about decision-making that taught me a lot about hashmaps and these data structures in Python.
https://github.com/python/cpython/blob/main/Objects/dictobject.c#L289
https://github.com/python/cpython/blob/main/Objects/setobject.c#L27
#comments #decision_making #documentation
In one case, I read the comments to understand the use cases and limits around a feature in the dict and set implementations in Python. Both codes are enriched with comments about decision-making that taught me a lot about hashmaps and these data structures in Python.
https://github.com/python/cpython/blob/main/Objects/dictobject.c#L289
https://github.com/python/cpython/blob/main/Objects/setobject.c#L27
#comments #decision_making #documentation
GitHub
cpython/Objects/dictobject.c at main · python/cpython
The Python programming language. Contribute to python/cpython development by creating an account on GitHub.