When I was making the transition from the procedural oriented programmer I was in college to the much more object oriented programmer I am now, I had many issues. I wish I could remember the specifics, but this one time at my first job I was trying hard to design the software I was working on in a good OO way. I came to a sticking point where I could figure out how I should do the one part of the design. I could see ways forward but they were decidedly non-OO. I went to Chuck, a coworker with years of OO experience, for advice and wisdom. Instead of showing me an OO way out of my corner, he redesigned the entire component on the white board. I left his office very frustrated.
delete the sentenceJust now, I am reading "On Writing Well" by William Zinsser. (yes, I am trying to improve my writing.) There is a paragraph where he tells you the trick for how to fix those problem sentences, the ones that no matter how you rearrange and reword it always sound awkward. His solution - delete the sentence.
Some years ago, when I was less experienced in Java than I am now, I was writing some code where I really wanted function pointers. I was complaining to Chris, who had the office next to me, about Java's lack of function pointers and he pointed out that if I restructured my code with interfaces I wouldn't need C's function pointers.
redefine the surroundingsTime and time again we come across problems which seem insoluble. When this happens, the stubborn individual persists at trying to find a solution while the more faint of heart gives up. Often times the best way forward is actually take a lesson from the faint of heart. Whatever it is you want - don't want that. The solution is to redefine the surroundings of the problem so the trouble area just goes away. That's what Chuck did, that's what William Zinsser says, that's what Chris did, and now that is what I try to do.