← Back to context

Comment by Ferret7446

3 years ago

> The worst feeling is "cleaning up" some code, discovering the edge case under which the "simple" case fails, then re-implementing the same solution.

Whenever I encounter this I:

1. Add a comment explaining why the complexity is needed, because it will happen again.

2. Add it to my mental list of case examples of when I need to add a comment explaining something the first time I write it.