Refactoring Reveals Truths

This is a really great post from Soroush Khanlou in which he uses a Swift function to demonstrate what can be learned from refactoring a piece of code. What starts off as a relatively verbose algorithm soon becomes a clean one line solution, making it much easier to understand and, as Soroush writes, revealing the algorithms beautiful internal symmetry.