When I started getting in to coding and started focusing on refactoring, it amused me how close that was to the process of writing poetry (at least the way I was taught). Write it all out. Then cut some, add less, cut some more, move some things around.