Live data from Hacker News

In defense of not understanding your codebase

seangoedecke.com

11–15 of 15 posts

Re: In defense of not understanding your codebase

#11

This reads an awful lot like post-how justification of poor business practices. It’s got a bit of”uhhmm actually, poor management and high turnover is good actually” vibes, which is then (over)extended to a kind of carte-Blanche justification of “why using kms and having no idea of what’s going on” is good-and-desireable. Which is like, certainly a take, and I can think of at least one “technical skills hating” exec…

I read it more as pointing out the inevitable and accepting the implications. You can not call it the result of poor practice when every business beyond a certain size has this problem. Perhaps the problem could be mitigated by keeping the company itself small, but that has nothing to do with programming anymore.

[deleted]

Re: In defense of not understanding your codebase

#12
>[codebases break down into small ones, well understood, and big ones, poorly understood]

I'm in a third category, where I have many small projects, and come back to each one infrequently, so that I'm more or less starting from scratch each time. Small codebases, rarely accessed, poorly understood.

(I noticed with dismay that with some AI assistance, I no longer understood many parts of my code. Then laughed darkly when I realized, yeah, I had that problem before AI too...)

I've been testing various techniques to remedy this. One of them was the Feynman Technique: explain (a narrow slice of) the codebase in my own words. The issue here is that it doesn't necessarily force contact with reality.

For example, one time I investigated my game's bullet netcode, and then explained it until I was satisfied I had understood it correctly. Except, my explanation turned out to be completely wrong, because it was based on an assumption I hadn't made explicit (and therefore hadn't verified).

So it's a good start -- and a great habit to get into, I think, explaining things in your own words lets you "inspect the objects of your own mind", to see if they are sound -- but a forcing function, it is not! It doesn't check your work.

I found one I like, though: modding. Making a change to a codebase. This forces your mental model into contact with reality. (It's also more fun, in my opinion. Most programming is archaeology, but archaeology in service of building something new is a lot more satisfying, at least to me!)

Re: In defense of not understanding your codebase

#13
The article links to another article by the same author, Wicked Features, which I now reposted to HN because it seems worth discussing:

> Wicked features are features that must be considered every time you build any other feature.

https://news.ycombinator.com/item?id=48932749

Highly related to TFA, in my opinion, this question of "how do you keep the code comprehensible in the first place?"

Re: In defense of not understanding your codebase

#14
Whats the discussion around architecting a codebase where you don't need to understand the whole thing to operate inside of it?

Which large/massive codebases are considered the best to work in and if we examine their architecture what provides for that?

Re: In defense of not understanding your codebase

#15
post #12

>[codebases break down into small ones, well understood, and big ones, poorly understood] I'm in a third category, where I have many small projects, and come back to each one infrequently, so that I'm more or less starting from scratch each time. Small codebases, rarely accessed, poorly understood. (I noticed with dismay that with some AI assistance, I no longer understood many parts of my code. Then laughed darkly w…

Well, that's why clean, well documented code is (was?) so important, because even if it's your code, you will forget and have to read it later.
Post reply on HN