4 ms·
This is roughly in line for my uses of comments. Ideally, code makes usage and implementation details obvious. In practice, subtlety occurs, and comments can
by MaulingMonkey 10y ago
This is roughly in line for my uses of comments.
Ideally, code makes usage and implementation details obvious. In practice, subtlety occurs, and comments can be useful to destroy that subtlety.
In Ruby it might be the type returned by a function - even though in C++ this would be obvious.
In C++ it might be the dividing line between when it's safe to throw exceptions, and when it's safe to mutate the object, to maintain your exception safety invariants - when in LISP everything might be immutable anyways.
In C it might be the special treatment of "-1" or validity of "NULL" as arguments, when in Rust you'd have an enum explicitly listing edge cases, or an Option<> making None s explicit.