I once spent a week trying to find a bug in an obscure set of nested loops — 200+ lines of relatively obscure Cython (“for efficiency”).
Walking home one night, I realized I could replace the whole thing with a combination of matrix operations.
200 lines of buggy code turned into four lines of Numpy that
1) worked
2) was much faster than the Cython
but which felt like it required a 200 line comment explaining *why* it worked.
(Also, while writing the comment, I found the elusive bug in the original code.)
Programming tip: When Guy Steele says there’s something to be gained from learning APL, don’t wait twenty years before following up on it.