3 ms·
Are they? I "run" systems in my head all the time. I'm familiar with the code base, from that I'll know roughly where the bug is. I can tell you which function
by mattmanser 9y ago
Are they? I "run" systems in my head all the time. I'm familiar with the code base, from that I'll know roughly where the bug is. I can tell you which function a bug will probably be in and how it's probably happening, just from having the symptoms described to me.
Hell, even when I'm not familiar I can guess what's happening based on past experience.
It's some sort of spatial ability, like navigating a map (though I recently found out I'm terrible at visualizing and almost completely lack a 'mind's eye'). I also find I rarely get lost in computer games and very rapidly learn FPS maps.
Maybe's it's one of those weird skills you don't even realise some of the population lack.
Personally I've always thought using traces are a massive crutch that are too expensive in cost vs benefit ratio, I don't get the point. Far too many extra lines of code for too little gain.
- psyc 9y agoI work this way to a large extent. I have pretty good recall of the whole codebase, sufficient to step through in my head and spot actual bugs while AFK. I really dislike it when people make assertions about what others supposedly cannot do.
- nsxwolf 9y agoI don't believe you.
- 5ilv3r 9y agoI believe this is called "being mechanically minded". If you understand the physical rules and the components, you understand the inner workings. Good mechanics have this. Bad mechanics don't. Sadly being an auto mechanic pays little, but the skills are obvious in good programmers too.
- foobarchu 9y agoYeah, this is exactly how my brain works, and has led to my specialty being finding the difficult bugs that have eluded others. I've got a loose leaf notebook that I use to help, but all that's really in it is rough drawing of circles with labels scraweled next to them, fashioned in a shape with maybe some lines between them. All it's for is helping me imagine the system better in my head to connect the dots. It's affected my design philosophy too, I always try to design software such that I could draw it as a series of discrete components with input/output arrows between them (and, of course, the assumption that could theoretically zoom in to a component to see whats inside of it)
- pharrington 9y agoWe are literally weeks into Meltdown/Spectre. The code you write runs on a complex programming language you didn't write, that may be running on a VM, that is running on an OS, that is running on a multicore CISC processor with 100s of publicly known instructions, that can only be built due to modern developments in quantum mechanics. You run idealized versions of systems in your head.
- esmi 9y ago"You run idealized versions of systems in your head." Definitely true but running idealized approximations of systems [1] are also sufficient, at least in my experience, to get a rough idea of where a bug might be a majority of the time. [1] We're basically describing https://en.wikipedia.org/wiki/Systems_modeling https://en.wikipedia.org/wiki/Systems_modeling
- pharrington 9y agoCertainly. I guess my main objection was to the parent questioning whether modern systems are "too complex to simulate accurately in your head". Effective programming, as you note, requires acknowledging that you are approximating, and understanding the scopes and ramifications of those approximations.
- ZenoArrow 9y ago> "You run idealized versions of systems in your head." Yes, they're idealised versions, but that still has value. The point at which the idealised model doesn't match up with reality is the point at which further investigation is required. It's an effective way of filtering out the parts of the system that you already have a reasonable grasp on so that you can focus on parts that you don't. On a more general point, almost all models are idealised approximations. The whole idea with modelling a system is to abstract away the rough edges by encapsulating complex behaviour in discrete groups. By working with these simplified models, the idea is that you gain a better intuition of the activity found within a system. In short, the whole purpose of models is to guide intuition.
- mattmanser 9y ago