A thing I've found myself doing lately:

You know when you come back to a program after months and you can't remember wtf you were doing or how it works?

When that happens, I sit down and comment the source of the entire program, or at least, the major files.

It works *great*.
Rereading the source just makes me zone out, but *commenting* it is exactly the right structural-thinking frame of mind to make me actually think about what I'm reading. It makes it easier to remember.

And when I'm done, the program's commented! I won't have to do it next time.
Another thing I've caught myself doing, though I'm unsure it makes sense: When I see something I don't understand in my own code, or don't remember why I did it, I leave a comment with my questions about why I did it, and sign it with the date I read it and found myself confused.
When I come back and see the comment again later, one of two things happen: by then I've worked out why I did it, and I can fix the comment; or I go "crud, I haven't been able to figure out why this fragment works for *six years*, this is very likely the site of a bug"
Since most software doesn't have a formal spec, most software "is what it does", there's an incredible pressure to respect authorial intent when editing someone else's code. You don't know which quirks are load-bearing.
This means comments that *reveal* authorial intent are valuable, and comments that reveal *there was no authorial intent* are even more valuable. Without those hints, you're left editing superstitiously, preserving quirks even when you don't know why. https://twitter.com/_eons/status/1274409718979715072
WHEN I READ THIS MY HEART SEIZED WITH SYMPATHETIC TERROR AS IF SOMEONE WERE TELLING ME A SCARY STORY AND IT ENDED WITH "AND ON THE WINDSHIELD… WAS A HOOK" https://twitter.com/anfael_/status/1274462849071382529
You can follow @mcclure111.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.