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 commentsFirst thing you should do is figure out what's wrong. Refer to what other people here are saying. Additionally, see if your family history includes a history mental illness or degenerative medical conditions (including dementia and Alzheimers). Everyone knows someone with this, you're looking for a pattern. For example, multiple people in my maternal grandfather's family had been institutionalized and most of the family had bipolar and schizophrenia diagnoses.
And now, how to still get your job done... :)
At one point in my career, my mental facilities became so compromised, I couldn't follow abstraction. Instead of seeking help, I figured out a system to overcome this.
What I did was externalize my memory. Quite literally, I would write everything I needed to paper: variable names, notes on their contents, call stacks.
Once the entire set of function calls where on paper, I could see the structure and continually shuffle things in and out of very limited working memory as I worked to understand and fix issues.
It's slow, but not as slow as you would think.
In my twenties, I can churn out things pretty much non-stop. I think I was trying to "prove it" and I could clock extras in the evening and weekends to move ahead. I could do something repeatedly until it was better than the last. I also tend to take on other people's tasks a lot.
In my thirties, I was still shuffling, not just me and my task but many other people too. I loved the messiness of deadlines, the near-misses, taking on new things, and being in the front of the battle, fighting in it and not flying over it.
I have now hit my forties; I realize I like to take time but do it right the first or second time. I also want to selectively do things with an outsized return on my time invested.
In short, I would have liked a Gatling gun in my younger days, but now I want precise sharpshooters. I'm of the opinion that it is OK to slow down, breathe, and take more targeted precision strikes.
Second, what you are doing is one of the most boring work there is. Try to find automated translator that can speed up the process (a least the boring parts). Writing one is not an easy task for most folks so I am not advising DIY. If you are doing this work for a 2 weeks or more maybe you are just bored?
Did you notice mental decline in other tasks? LeedCode & stuff? Chess? Forgetting words? If this is only work related it may be burnout. If not, you may try to revisit your lifestyle: did you recently gained weight? are you eating healthy food? do you have enough exercise? In any case it may be a good time to make an MD appointment.
Of course the code can also be particularly convoluted with some domain-specific knowledge that you may not necessarily be an expert on, so in that case, I'd find someone to ask questions or or an intro book until you can get to an 80/20 situation, where you feel like you understood most of the domain context.
If it's not the code, take a break. Long walks in a place with trees helps clear the mind. Longer sleep, exercise to get the blood flowing, no alcohol. All the usual healthy stuff.
You could also try to draw the data flow on a whiteboard, in a "follow the money" kind of way.
Alternatively, if time permits, try to reimplement the algorithm or solve the problem yourself, in your own preferred language/environment. This will get you sufficient knowledge about the functional requirements where you'll be able to see what the author of the code you're porting was thinking, since they likely encountered the same challenges as you.
If nothing else works, you can just be honest with your manager and try another project that feels like it would be easier or more fun.
Good luck!
All comments shown.
Couldn't load more comments. Check your connection and try again.