3 ms·
>so instead of having to understand every single line each time you come across it, you can extract the meaning into a name. Until you really have to understan
by inertiatic 6y ago
>so instead of having to understand every single line each time you come across it, you can extract the meaning into a name.
Until you really have to understand what is going on, like when you need to fix a bug or refactor.
Then suddenly you to deal with the overhead of holding the branches of 20 levels of indirection in your working memory.
Also, this assumes the people you're working with are great at naming things. Which, from my experience, is almost no one.
- capableweb 6y agoIn general, we have higher-level programming languages so we can do just this, hide the complexity under indirection. It's basically the purpose of the languages we tend to use today, otherwise we would all be still using assembly. Your job as a programmer is being able to walk this ladder of indirection up and down until you find what you seek and fix/add/remove whatever. You'll always be dealing with way more than 20 levels of indirection when programming, even with a "hello world" program. If adding two more levels of indirection makes your mental model break down, you might consider upgrading your environment/workflow a bit to support this. Regarding naming I agree with you. Good names are really, really, really hard to come up with. Entire books have been written on how to name things. Doesn't excuse us from trying though, the only way we can get better is by doing.