2 ms·
One of the things I find myself needing to push both junior _and_ senior developers to do is "if you are thinking about code being anywhere adjacent to 'subtle'
by btown 2y ago
One of the things I find myself needing to push both junior _and_ senior developers to do is "if you are thinking about code being anywhere adjacent to 'subtle' or 'weird,' or think that something might become a design pattern for future code, or something that was copied from other code but differs subtly, or you consulted StackOverflow... write the comment that's in your head/leave a breadcrumb as an actual comment in the codebase." And, frankly, this sometimes means commenting-out rather than deleting code, if the historical code was necessary to understand the context for why the improvement is warranted.
I wholeheartedly agree with the OP that "churn" can result not only from staff members leaving, but also from them shifting focus to other projects or even just growing in skillsets over time. Which is why it's vital to document the mindset you had as you were coding.
One of my favorite books, Vernor Vinge's Hugo-winning _A Deepness in the Sky_, uses the term "programmer-archaeologist" - https://akkartik.name/post/deepness https://akkartik.name/post/deepness is a great (spoiler-free) quote on the notion. Writing for your future archaeologists - who may very well happen to be your future self! - is a great mental model to have.
(And read Deepness - despite its branding as book 2 in a series, it's arguably best to read it standalone first! It's simultaneously an action-packed popcorn novel and a mind-bending set of discussions on linguistics and cultural relativism as they pertain to mechanisms for societal control, in a way that makes the reader part of that very conversation. Highly, highly recommend.)