Re:On Comments in Code
by OJFord on Wednesday June 16, 2021 @07:12AM
(#27527158)
> Tests are useful, but the big reason that comments are useful is that they are co-located with the relevant code.
That's a not-often-talked-about (that I see anyway?) thing I really like about rust - I don't get to use it much, but when I do I think having 'doc tests' alongside comments heading a function and 'module tests' at the bottom of the same file is great.
That's a not-often-talked-about (that I see anyway?) thing I really like about rust - I don't get to use it much, but when I do I think having 'doc tests' alongside comments heading a function and 'module tests' at the bottom of the same file is great.