3 ms·
It is very explicitly not a post about React, which is why React was not mentioned until the middle. It is a post about properly documenting your code in order
by filoeleven 4y ago
It is very explicitly not a post about React, which is why React was not mentioned until the middle. It is a post about properly documenting your code in order to understand why it is there later.
The example could be any code that interacts with dependencies which get updated from time to time. Instead of “why do we stop propagation here?” the question could have been “why is this float converted to a string here?” If the answer is not clear from within the same function call, it may (may!) need a comment to clarify it.