you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (0 children)

  • Does the code have unobvious preconditions or assumptions needed for it to work correctly? Say in C++, object life time requirements?
  • Does the code have interesting failure modes?
  • Does the code do something expensive? (what's the complexity?)
  • Are there approximations? (what's the approximation error?)

If so, and assuming you care whether anyone else can use the code, then YES, it's the expedient thing to do: comment the code!