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
As we age, we usually end up with more and more life responsibilities, beyond just the work we are doing. All of that is input to the brain and requires energy in response. The brain is not infinite.
I often feel as you do, but then I have periods where I am as light and agile in my productivity as 20 years ago, maybe even more so, and usually it is my life circumstances that are the culprit.
I remember once about 13 years ago I was working on a mobile game and had a similar problem as you describe; there was one day where the technical work seemed to overwhelm me and I felt inadequate. But I was just a young chap, and it was a passing moment -- I had indeed just taken on some enormous new life responsibilities at that time, which were the likely explanation.
Burnout is real, too, and giving yourself space (if you can) to relax and not think about work for a break can be quite useful to recharge.
Continue this thread — 5 replies
Continue this thread — 3 replies
http://notinventedhe.re/on/2011-11-9
Not that I'm good about those things - I do OK but not great. Sometimes (rarely, thankfully) my energy is so low I can't really code at all, sometimes I'm flying. I'd say by far the biggest factor is my overall state of positivity and optimism. And yeah, life definitely gets more complicated as you get older.
Continue this thread — 1 reply
I recently did a big change in myself - adjusted sleep, took specific supplements which I was suspect was deficient in and have found my energy to be much fuller. Do not ignore what your body is telling you.
Continue this thread — 9 replies
I think it fries your dopamine and other neurological circuits. I don't know the science in depth but I have seen enough anecdotal evidence on myself and others to be persuaded that the relationship is huge.
Do a screen fast for a couple of weeks and check out what happens.
Continue this thread — 1 reply
Continue this thread — 1 reply
Continue this thread — 2 replies
Western diets (e.g. the standard american diet... what we actually eat) is fairly bad for our health which impacts our abilities.
I would recommend folks look into the Blue Zones. Where people live the longest and thrive for the longest. Look at their eating and lifestyles. One of those zones is in the US where people have work/life balances similar to folks here.
In my case, changing my diet and activity level caused my energy to go up and mental clarity to improve.
After a year of this I've dropped 20kg, and my mental clarity is back where it was when I was early 20's.
I think it was mostly the no sugar that did it.
Exercise too - I walk 2-5 km a day
Oh and cutting down what I eat too -- I only have 1 meal a day, and a smoothie in the afternoon
Continue this thread — 5 replies
This is an amazing insight. I’m almost 46 and feel like I’m at the top of my game, programming-wise, but also, I’m probably at my healthiest. And that’s worked-for health, not the kind that comes for free in your 20s (generally). And I think about and pay attention to energy levels during the day, and just know when I’m toast for the day and time is better spent elsewhere. I take a brief afternoon nap before coffee most days. I pay attention to when my mind is receptive to new information. I let some things bubble away in my subconscious and sometimes make new insights on walks, in the shower, or while making coffee.
Where can I obtain this for free energy?
As somebody who far away from 40, how is one supposed to "look forward" to getting older given this likelihood?
Continue this thread — 12 replies
Continue this thread — 13 more replies
Either way, at the time it was quite worrying - even disturbing - especially when there was work to be done, so think I can relate
Generally I was able to reverse it by working on something which really stimulated me - even hacking away on some goofy personal project after hours - and that kind of bootstrapped me back into a place where I could easily attain flow for "harder" tasks. Can't recommend that highly enough, that and realising that I had different stimulus needs to previously - changing up my coding music, or even foregoing it and switching to mynoise.net yielded some excellent results, or reducing distractions (try periodically disabling system notifications)
That said, if you're really concerned probably see a doc just to rule out any funny business
Ps. Best of luck with it, crossing fingers for you
So when I get stuck now, I just start writing code like I would have when I was early 20s.
Continue this thread — 1 reply
Some days you just feel down and are barely able to function, others you have seemingly unlimited energy, and this can come from a whole host of factors : how did you sleep, what did you eat, what is the weather, how is your personal life going...
And of course things get worse as you age (with quite a lot of variation and personal responsibility in staying healthy).
I’ve experienced this a bunch of times too. I’m sorry to say this, but burnout for me never goes away on a convenient schedule. The more I make myself wrong for feeling overwhelmed, distracted and unmotivated, the worse it gets. Or in other terms, problems are rarely solved with the same thinking that created them.
For me, I have to really give myself permission to step back, take stock of myself, get some sleep and good food and often take a break from “work” programming tasks for a few weeks. (And I know exactly how inconvenient that last part is).
The more I push myself to feel better already, the longer it takes.
"even more advice": Issue is likely mental focus (since you have a finite daily mental, emotional stress budget)
https://www.goodtherapy.org/blog/breaking-the-chains-finding...
- (let go of) mental re(re)view. "This too shall pass".
+ (embrace) "just do it" && "Don't worry, be happy".
! (remember) chemical dependencies, if any, must be brought under control.
Write down what are the big challenges/problems, try to break them down and write about it, keep dividing it until you start to see that you can tackle the indidual pieces.
I'm 42 and I've been in a mental place similar to yours, but a little more drastic due to a hard time in my life, and it took a while to get back into top shape, but the effort to break down my problems on paper helped me tackle some immediate tasks I had to accomplish.
That one exact thought is compounding your problem. It's pure anxiety and it makes problem worse, I know from experience. When you think that, try to calm yourself with "yeah, it's just anxiety speaking, it will be fine". Maybe also try magnesium supplements, magnesium citrate helps me (but it typically takes up to a week of supplementation, minimum 2 days).
.. which honestly sounds an awful lot like the stress of the situation (or concern about cognitive decline) - which isn't going to do your focus any favours!
Any kind of reset can help with that: go for a short walk, chuck some binaural beats on headphones and close your eyes for 5 mins, drink a warm (non-caffeinated) beverage and think about something else.
Above all else: probably good to just remember everyone has off days, other engineers aren't going to judge you for a day of lower productivity
Aside from reducing your internal stress, One key ingredient of finding "flow" is a sense of immediate feedback, perhaps allocate 20 mins to some short tasks which give rapid reward; write a couple tests, draw a diagram, etc..
Binaural beats (use "relaxed"): https://mynoise.net/NoiseMachines/binauralBrainwaveGenerator...
Going for a walk is kind of a lightweight "shower effect", random article link: https://buffer.com/resources/shower-thoughts-science-of-crea...
(Sorry, time zone mismatch slowed my response)
Link dump (for reading some other time)
- stress and brain function: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6504531/ - flow state https://en.wikipedia.org/wiki/Flow_(psychology)
Good habits and lifestyle changes take time.
The only other option that has worked for me would be drugs like Adderall.
Continue this thread — 4 replies
I think what we have to deal with is not just cognitive decline, but more importantly cognitive overload. People in their 40s usually juggle lots of responsibilities, especially if they have a family. At this age you normally also have earned some money, and if you start buying things like a summer house or an apartment for renting out, those things come with maintenance tasks. This can accumulate quickly.
Whatever the reasons are, my approach was to get used to it and work differently. I am terrible at doing multiple things at a time and my short-term memory is bad, so I learned to concentrate on one task at a time and eliminate distractions. I buy large monitors, so that I can have multiple things on the screen at the same time and avoid having to remember (I can easily forget an IP address when switching windows!). I spend money on Apple hardware, because of 5K displays: 5K makes a huge difference, because I can comfortably have THREE columns of code in my fullscreen Emacs instead of two. That means I often have 5 different pieces of code visible, which does wonders for things like APIs, which you mentioned — I can follow the entire path of a call and keep it all on screen.
I also noticed that there are positives that come with age and experience! I find that I'm much better at seeing the "big picture", analytical thinking, design, and predicting potential problems. Most importantly, I'm now much better at knowing what not to do. These skills are invaluable when running your own business.
Continue this thread — 4 replies
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.
Continue this thread — 14 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.