The reason for writing a function is not to reuse its code, but to name the operation it performs.My first pompous thought was something like, "how obvious." I was about to go back to work when a memory hit me out of no where. I remember very early in my career F5-hacking on some code and thinking about creating a method but worrying about not reusing it, or about someone else reusing it incorrectly, or about the extra lines of code the added syntax would add to my already 1000+ line Windows Form class.
— Tim Ottinger (@tottinge) January 22, 2013
I remember programming like that. There was a time, not long ago, when I didn't think I should extract a method unless I meant to use it more than once! And it's weird because I don't remember having the epiphany that took me from where I was then to where I am now. I once thought A, I now think B, and I don't remember changing my mind. It's an interesting lesson in the way the mind works. And it reminded me that everyone was a newbie once, and that most likely, I still am a newbie I just haven't figured it out yet.