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 commentsI can't help but think of Donald Knuth, aged 85, sat in his home office somewhere, still chipping away at some of the hardest problems in computer science.
It sounds like your problem is something more temporal. For instance, someone else here mentioned about other stresses and responsibilities in your life for example. It might be that it's just a boring and arduous task, not everyone excels at tasks that are just not that interesting. Besides, I don't think the vast majority of us are good at remembering layers and layers of calls and abstractions.
My advice is, there's probably nothing wrong with your abilities or your brain, just try to work on small sections at a time and don't be hard on yourself. We're not 100% all of the time, there are so many factors that play a part in how we perform on each task.
I'd also say that, 40 isn't particularly old, it's easy to think that when so many engineers are in their mid-20's, but in the grand scheme of things, your cognitive abilities probably haven't changed all that much since you were twenty-something. Hang in there mate.
But I'm not perfect. I'll miss a detail, I'll get a message in the chatroom, I'll take a stretch break. I'll forget. That's not just me being 40, that's me being human.
There's also the fact that when you're younger your body lets you get away with "murder": Drink lots of coca cola, eat junk food, sit for hours, never hit the gym. An apt metaphor would be that you had a 10k PC for gaming and lots of games that were not optimized properly but run well enough due to the hardware being that good.
The older you get, the more your bad habits bite you. So it's not just age decline but every lack of maintenance and abuse of drinking, smoking, junk food comes to take its toll. You know, the "I can do that while I am young" kind of habits.
What I'm saying is, it's more than aging that it's at fault. We just like to correlate aging with it because it takes years for the side-effects of all the poor habits to manifest themselves to take effect.
I want to work with programmers like you. I really do. I don't want colleagues that can dive through stacks untangling complicated messes effortlessly. I want colleagues that are sensitive to every cognitively burdensome aspect of the codebase and _need_ to fix it to continue working. These are programmers that will be methodical and wholesome in their approach, and will deliver code that is easy to work with. I'll choose a programmer like you over a young-gun-star-code-cowboy every day of the week.
That said, if I were you I'd ask myself if the problems I'm having are inherent in the problem I'm solving, or in the approach I'm taking. I'm somewhat younger than you, but I have horrible working memory (sounds similar to what you're describing), and my self-development as a programmer has been mostly centered around finding ways to make that irrelevant.
Also, you might be interested in the Huberman Lab podcast. He's a neuroscientist and has episodes about ways to improve things focus and creativity.
All comments shown.
Couldn't load more comments. Check your connection and try again.