3 ms·
Sounds like you've identified your problem with the task - you can't hold the entire state of the problem in your head all at once, but maybe you would have bee
by cr3ative 4y ago
Sounds like you've identified your problem with the task - you can't hold the entire state of the problem in your head all at once, but maybe you would have been able to in the past.
This seems like something you can overcome. Have you tried writing these function calls out as a flow on a piece of paper, or in a flow chart, document, something like that? A reference which you draw to be able to tell where you are the stack and where you came from.
It sounds like a very crusty task and I doubt I could maintain that many levels of calls in many different contexts. The important thing is finding a mechanism which works for you.
edit: I'd note that it's possible your development environment is older than your colleagues, too. Many modern ones (VS Code, etc) can jump around a codebase automatically - find callers to a function, jump to where the next function is defined, etc. Maybe check their setup and see if it's worth adopting.
- shkkmo 4y agoIDE code intelligence can help a lot. Anything that makes reduces the cognitive load of navigating within the codebase helps increase the mental capacity you have to keep the context loaded. When tracing deep call stacks I can find it helpful to write out the question I am looking for the answer to in a comment. Then I can retrace my thoughts back up the callstack using the very handy shortcut to go back to the previous curson position.
- pohl 4y agoThis is good advice. Just a few days ago I randomly stumbled upon a youtube video where someone was using — blast from the past, here — a hunk of green bar line printer paper as a big scratch pad to write on. It made me wonder how I ever got out of that habit. That stuff, when it was ubiquitous, was the best scratch paper ever, and I used to do it all the time when I was young and, one would think, at my cognitive peak. Maybe falling out of that habit is part of my percieved decline.
- rightbyte 4y agoI would want one of these Etch'n'Sketch but with a pen and some higher resolution. The variant where you pull a lever to reset it. Whiteboard markers are too wide and I am left handed so I erase as a write. And using paper makes it feel like I am wasting paper.
- gapan 4y agoThose things exist. You press a button instead of pulling a lever. Search for "drawing tablet" or "writing tablet". I've got a 20" one by Xiaomi, but there are lots to choose from, very inexpensive too.
- pohl 4y agoDoes that really work out, with regards to waste? I mean, does something with a circuit board, a battery, an LCD screen, a case, a stylus, and a limited lifespan really end up being greener than renewable, recyclable, compostable plant fiber?
- rightbyte 4y agoEtch'n'Sketch doesn't have batteries right? Or am I remembering wrong.
- LastTrain 4y agoI do this. I was burning through a lot of paper and ended up going with a reMarkable tablet which is perfect for that sort of thing.
- dkarl 4y agoCharles Simonyi said: "It’s probably just that aging changes your mode of thinking. Right now, I have to really concentrate and I might even get a headache just trying to imagine something clearly and distinctly with twenty or thirty components. When I was young, I could imagine a castle with twenty rooms with each room having ten different objects in it. I would have no problem. I can’t do that anymore. Now I think more in terms of earlier experiences. I see a network of inchoate clouds, instead of the picture-postcard clearness. But I do write better programs."[0] I can believe the part about better programs. Can you imagine working with somebody who can clearly visualize software with 200 sub-components in it? I once worked with software written by someone who had similar powers. He was a hardware designer. His software had very little organization; he wrote imperatively and remembered where everything was. Six months after he handed a program off to me, I spoke with him and told him I was currently trying to figure out where a particular component was initialized, and he told me exactly where, in what part of what file. IIRC, some hardware registers were being initialized in a procedure that was allocating working space for a numerical part of the program, because that's here he happened to open the log file for the first time, and he wanted the logging from the hardware registers to be the first thing in the log file, before he logged the fact that the memory had been allocated successfully. He remembered this with no hesitation, more than six months after he last touched the code, possibly two years after he made the decision to initialize the hardware in that spot. Someone with less mental horsepower, like me, has to organize their code into modules with clear names and responsibilities. [0] https://programmersatwork.wordpress.com/programmers-at-work-charles-simonyi/ https://programmersatwork.wordpress.com/programmers-at-work-...
- bqmjjx0kac 4y agoThanks in part to ADHD, I'm sure, I have severe tunnel vision while reading and writing code. I need to constantly diagram, take notes, and walk through call stacks (and re-walk) just to maintain my mental model. I am insanely jealous of people who can keep everything in their head. Maybe there's a silver lining in that my methods are more resistant to brain-busting situations, depression, cognitive decline, etc., but I'm not sure that I'm convinced.
- 4y ago
- eterpstra 4y agoYesterday's top post linked to this tool: https://www.knotend.com https://www.knotend.com It's a super fast/light flowchart editor. Might be useful!
- contingencies 4y agoUse graphviz[0], forget manual graphing. While many tools can generate a call graph, confidence rolling your own is a good superpower to have. For example, write a quick script to add a panic (nonexistantFunction()) as the first line of each function. Then, call each function in turn. Save the panic's function stack trace, then process them as a combined graphviz file. This simple and efficient hack will get you all the most important edges in most cases for most languages. It won't get you the internal links, for those you need a more effective parser or more exotic means of obtaining branched call stacks. [0] http://graphviz.org/ http://graphviz.org/
- ok_computer 4y agoI second the idea to draw out in a simplified flow chart like visio or excel boxes or graph paper. Nothing fancy, no ISO standard schematic, just journal sketches. The context being not the entire system design but for a single call what is the flow. That helps me in the weeds and out of the editor thinking. Also it may be 2h to do it for a simple case but I’ve found spending that drafting time helps think about the problem in entirety and saves time in the editor.