3 ms·
I mean, sure, if you have what looks like a simple getter function for temperature that doesn't support negative numbers, represents it as tenths of a degree in
by scarmig 8y ago
I mean, sure, if you have what looks like a simple getter function for temperature that doesn't support negative numbers, represents it as tenths of a degree in ints, and can only be set by a recurring background process, you probably should be commenting that.
Good code doesn't document itself, but bad code with comments also don't document itself, and good code with comments has a surprisingly short half-life of self documenting efficacy.
Nontrivial public classes should include solid comments, along with interesting methods, but you don't need to be commenting a simple getter or a parameterless constructor.