3 ms·
+1 I think, though it's hard to tell from a written description whether you're describing the same mechanism I use to get around a codebase. I usually think of
by nostrademons 18y ago
+1 I think, though it's hard to tell from a written description whether you're describing the same mechanism I use to get around a codebase.
I usually think of my mental model of the code as being a map, yet it's not a visual, 2D map. It's more a collection of associations - I know that if I follow this function, it'll have this effect on the world, and this function is used from 4 other places, all of which need it to do this, etc. It doesn't really map well onto 2D visuals at all, because I suspect code has way more than two dimensions. But maybe like a massive graph lattice...
I use the same mental mechanism for getting around town, so it's definitely spatial, but not necessarily visual. I guess the best distinction I can draw is to compare looking at a map of a town, vs. actually living in the place. For example, I got lost today in a twisty residential cul-de-sac while hunting for an estate sale that never did materialize. But I knew I was in the corner between 101 and 85, and I knew I'd come from Middlefield, so in the course of driving around I managed to put together a mental map that got me out of there. (FWIW, I was here: http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Mountain+View,+CA&sll=37.0625,-95.677068&sspn=39.592876,76.376953&ie=UTF8&ll=37.405466,-122.072364&spn=0.004858,0.009323&t=h&z=17 http://maps.google.com/maps?f=q&source=s_q&hl=en&...).
I find that I can't stand visualizations of software - they always confuse me far more than just looking at the code does. I'm not sure why - maybe it's because it's a leaky abstraction, and there're always connections that are very necessary that aren't represented on the diagram.
- mdakin 18y agoI think you could describe the structure as being a directed graph with labelled edges and stuff inside each node. You build it up by inspection, debugging, documentation (when it's around), experimentation. You know who calls x. You know what x does. You know what x touches. You know who else touches those things too. What does that one do? Hrm. gasp (literally). There's the race! :) "He fixes radios by thinking!" But again the graph idea is a formalization. It's more fuzzy and messy in my head. The graph is not perfect and requires care and feeding to stay alive. And you don't actually see the whole thing at once. You can move around inside it but there is a focus. It's something your subconscious operates on as much as your conscious mind. And it's the subconscious that generates the intuitive flashes.