4 ms·
Yes, I think your example is better because "// Set the value of b to the number of iterations we'll be making" is almost the same as "/ Set the value of b to 3
by thdrdt 6y ago
Yes, I think your example is better because "// Set the value of b to the number of iterations we'll be making" is almost the same as "/ Set the value of b to 3" when the code explains that `b` is used for the iterations.
- ChrisMarshallNY 6y agoI actually take it forward a bit more in that article, to where clear naming eliminates the need for a comment at all: - With a good name, we could probably do away with the comment entirely: let numberOfIterations = 3 - It’s a fairly exhaustive article (but kind of a long read). Documentation is an important topic. https://medium.com/chrismarshallny/leaving-a-legacy-1c2ddb0c8014 https://medium.com/chrismarshallny/leaving-a-legacy-1c2ddb0c...