Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
596 pointsI feel like my past self could have handled this task, but I am really struggling. Porting this API will require a deep understanding of the existing API, which, of course, has several layers of abstraction.
I can't seem to hold more than about 2 levels of call stack in my head. There's the entry point function which calls other functions, which call other functions, which call other functions, etc. You know how it is, code calls other code, and logically it forms a tree of calls and return values that often goes several layers deep. I struggle to hold more than about 2 levels of this call stack in my head. By the time I'm down in the weeds I've forgotten what I'm doing, what the purpose of the actual API call is.
I don't know how to break this into small enough chunks that I can understand it or make progress on. Imagine I gave you the code for the sha512 algorithm, and a hash, and asked you to find the pre-image (the input). This is how I feel. Where do I even get started? How do I find even a single chunk of manageable work to break off.
The hard part is, several other developers are making progress on porting this API. Why can't I? What happened?
I don't know if this task is just an especially bad fit for me, or if my mental abilities are declining?
Comments (510) 299 threads
Earlier commentsMaybe you can pair with one of the other developers? If they are junior, they could benefit from your experience and insight and you could benefit from their focus and ability to navigate the massive codebase.
Other things you can try (work for me): getting comfy in a small and cozy room, turning the lights off or putting in noise cancelling headphones. Move the phone away and turn off any notifications. Better yet, have a dedicated machine for coding with no logged in accounts.
Ome last thing, you may have undiagnosed ADHD. Mine became progressively worse in early 30s. Self medicating through caffeine no longer worked for me. The doses that were effective were making me severely anxious and sometimes nauseous. ADHD meds have removed the negative side effects of caffeine and helped me feel a little more normal.
Sorry about the long comment: there’s a lot I can share from my perspective, but I don’t know if any of it helps. Feel free to comment back if you’re interested in touching base.
Get a blank sheet of paper and a writing utensil. Not a text editor.
Use arrows, add notes on the side. Whatever helps. Try to get one API call stack.Start at the top of your call stack and start making a diagram that resembles a directory tree:
I don't do this often, but it helps especially when I'm not familiar with the patterns used in the project, or I'm having a groggy day and having trouble thinking "deep". It seems to help to me to try and reason about it away from the distractions of the IDE and the OS.
[0] "Memory Diagrams: A Consistent Approach Across Concepts and Languages", Toby Dragon and Paul E. Dickson
I found that I was much more interested in how the work impacted customers, how we could work more effectively as a team, building relationships across the company I am at, etc.
At 48 I switched from programming to managing. It was a good move for me. I don’t love managing the way I once loved programming, but I periodically reassess and realize that although it’s fun to take a day and write some code here and there, I would be pretty miserable if I were to go back to it full time. I would constantly have to find ways to motivate myself to get anything done.
I do still take those days sometimes and write code for our product, but keep myself off the critical path at all times.
Management may or may not be for you, but it’s something you may want to consider. I wish I had moved over sooner.
As an aside, I had read in my twenties about a theory that claimed something happens physically in our brains as we age that explains this phenomenon of greater interest in the big picture and less interest in detail-oriented work but I have never gone back and tried to confirm or learn more about that theory.
That said, I still managed to pull out a few nights of programming (the Synacor Challenge) and debugging, occasionally till 2AM while I barely get much sleep because we are trying to ditch the pacifier.
I have a feeling that humans can still burn extra mental energy when really driven, to certain limit. But in 40s we are driven by far fewer things than in 20s, and we need more rest for these burns. The up side is I know ourselves better now than in our 20s so I can at least achieve something. Back when I was in my 20s I spent most of the time playing games and failed to learn anything properly.
All comments shown.
Couldn't load more comments. Check your connection and try again.