Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m not a developer but someone who is curious about development, can you explain what it means to have a good “mental model of the code”. Does that mean where you understand all code and what it does?


That's at the deepest level. I'd say you can stop one level up: knowing which function serve which purpose, which functions call which functions, which objects maintain which state etc. If you can trace any input/request from the event handler all the way to the database and back, then that's a very good start.


Yeah I think that's correct. It's the combined effect of being able to read the syntax of whatever language it is (Ie understanding code at a small-scale, which is different for all langs), and also to be able to understand/imagine the overall behaviour of it: at a larger-scale, which I think is largely language-independent. I think of it as similar to imagining how to do something or imagine how something works. The analogy could range from as simple as 'how to make a cup of tea' (a small script, or single method say) all the way up to 'how a car engine works'-level like big codebases (kernel, llvm, code-for-whole-app kinda thing).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: