4 ms·
> Anger narrows your focus of attention on what you consider to be the 'threat' or 'obstacle', and anyone who's done technical work knows that the solution is o
by dkarl 4y ago
> Anger narrows your focus of attention on what you consider to be the 'threat' or 'obstacle', and anyone who's done technical work knows that the solution is often found by divergent thinking.
This is an interesting perspective. For me, anger sometimes helps me break out of a patient grind on a poor approach to a problem so I can consider more radical, divergent approaches.
For example, week before last, I did a refactoring that affected a few dozen lines of production code, felt good about the change, then ran the complete test suite and discovered hundreds of lines of test code that I had to fix, across dozens of files, because of fixture code that was copy-pasted between files instead of shared as well as rampant use of unnecessary mocks. My patient, responsible side started making the fixes one by one and scolding myself for feeling angry about it, telling myself we're all learning, etc., and this is part of working with less experienced programmers. I guess I'm at a point in my programming journey where for a while now I've been suppressing my elitist tendencies and conditioning myself to accept that it will be my teammates' level, not mine, that dictates the quality of code that we produce, and internally chiding myself for even thinking of it as "shitty code." But this time I snapped. I was too disgusted by what I was doing. I had such a strong "fuck this" reaction that I stopped making the fixes and left my office fuming. I came back an hour later and started consolidating fixtures and rewriting tests. It took me almost a week of unplanned work, but it made me so happy to just fucking kill that shitty code instead of making myself patiently, dutifully deal with it.
I think it was the right thing to do from a team leadership perspective as well. My teammates were surprised at what I was able to do, and now they can see a better way to write tests. We probably won't get that full 4-5 days of effort back in the specific part of the code I was working on, but I am optimistic that future code my team produces will look more like the cleaned up version than the original mess, and the effort will be paid back that way.