News for hackers. Stuff that matters.
Re:Climbing the infinite ladder of abstraction by chriswarbo on Sunday August 14, 2016 @10:09AM (#12285612)
> When I want to refactor my first step is to inline code and data until it cannot be inlined further, so that new approaches for reuse appear.

I do a similar thing. My first attempt is usually full of layers of helper functions and not-quite-right abstractions as I was simultaneously trying to understand and solve the problem.

Once I've got something that works, I refactor it to collapse these layers and remove the bias introduced by my previous fumbling. Inlining reduces external references, and point-free style eliminates local references ( https://wiki.haskell.org/Pointfree ).

After such a refactoring, the code is dealing much more with inescapable features of the problem, rather than fighting against itself. At this point, I can do a final cleanup to introduce abstractions to reduce redundancy and aid understanding.

There are no comments on this comment yet.