2 ms·
> As I prepared my presentation, I found myself falling into my usual pattern when trying to really understand a piece of code—in order to grok it I have to ess
by wduquette 3y ago
> As I prepared my presentation, I found myself falling into my usual pattern when trying to really understand a piece of code—in order to grok it I have to essentially rewrite it. I’ll start by renaming a few things so they make more sense to me and then I’ll move things around to suit my ideas about how to organize code. Pretty soon I’ll have gotten deep into the abstractions (or lack thereof) of the code and will start making bigger changes to the structure of the code. Once I’ve completely rewritten the thing I usually understand it pretty well and can even go back to the original and understand it too. I have always felt kind of bad about this approach to code reading but it's the only thing that's ever worked for me.
This has also been my experience over the last thirty-odd years, whenever I have to take over maintenance of someone else's code.
- csours 3y agoThere's probably a better way to say this, but here goes: Anything you learn before you start working on something is familiarization. Familiarization is important, but it is not working knowledge or understanding.