Re:Writing Well-Documented Code – Learn from Examples
by kyleee on Saturday September 04, 2021 @01:34PM
(#28417121)
Good point. Also the phrases in the initial comment "token bucket capacity" and "refill time" may serve as hints and can be used as entry points to searching external documentation.
Re:Writing Well-Documented Code – Learn from Examples
by codethief on Saturday September 04, 2021 @03:27PM
(#28418257)
I agree, though I think it would be even better if variables were named "token bucket capacity" and "refill time" in the first place.
Re:Writing Well-Documented Code – Learn from Examples
by bcyn on Saturday September 04, 2021 @01:42PM
(#28417226)
It’s hard to judge out of context. IMO None meaning “disable limiting” should be a docstring/comment at the method level, describing what its return values mean, not inline next to this code.
Also, one thing I think doesn't get mentioned enough is the use of comments as anchors for text search. Having "disable limiting" expressed in English that way makes it easier for newcomers to explore the codebase.