3 ms·
Interesting, I have always viewed those as very different things. Comments explain non-obvious things. For example, "this is a custom search because it was fou
by gregmac 4y ago
Interesting, I have always viewed those as very different things.
Comments explain non-obvious things. For example, "this is a custom search because it was found to be 2.3x faster than .find() for this use case" or "this is sent as a string for backwards compatibility with ExternalRandomApi v1.2" or just walk through a complex algorithm.
I typically only go into archeology mode for two reasons:
1) I found the source of a bug and want to see when it was introduced and why. This is most helpful to prevent reintroducing an old bug, especially in old code lacking unit tests.
2) Someone wrote code that should have been commented, but wasn't.