Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
271–280 of 534 posts
Re: Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
#27238 here, I've definitely noticed a bit of a decline in overall power a year ago. Have you looked into what you're eating and doing for exercise? You definitely cant power through brainfog with caffeine anymore. try the following to get yourself back on track 1. first meal of the day should be a filet of fatty fish like salmon with skin. if you can't afford this, use a high quality fish oil pill like nordic naturals.…
Kippers!
I don't know if they ever had them in the USA. They seem to be seriously out of fashion in the UK; in the seventies, supermarkets used to sell them in plastic sachets, but nowadays it seems the only way to get them is online (or maybe you live in a town with a real fishmongers).
I don't generally like fish, but I'd eat kippers if I could get them.
Re: Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
#273Sounds 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…
Charles 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…
To be fair (haha) I went from writing super organized code with loads of concise, well-documented files to writing code just as you describe when I started designing hardware and writing more complicated embedded firmwares. For whatever reason, hardware initialization boilerplate doesn't like to be spread out or organized. As soon as you try your code ends up breaking outright or becoming a vastly more complicated, gigantic mess.
It's because the hardware is soooo specific and we as software developers want to make interfaces that are as generic, high-level, and re-usable as possible. Example: You can't just write a function that takes two pin numbers and initializes I2C on them so you can talk with some module. You usually have to know--ahead of time--which two pins you're going to be passing to that function (so the types match; because each pin has its own special type haha) so the function can initialize the correct I2C bus on the chip (in the right way)... Which immediately makes such a function non-generic and kinda pointless since you'll never be able to re-use it in anything else for any other purpose. You quickly get into the habit of saying to yourself, "Why am I making this a separate function again?"
Also, the order of operations matters so much more in embedded stuff than it does in regular software. I could totally see the situation where you want to initialize logging immediately after initializing some hardware because you want the logs to reflect values that you only happen to have available during initialization... You don't need them after initialization so why waste precious memory keeping variables around just so you can log them later? Just setup the logger in the same code, write your variables, and be done with it!
Makes sense, right? Hah! Only in the world of embedded firmware!
Re: Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
#274If you are worried about cognitive decline, I recommend starting weight training. I have found after weight training for under a year now my memory and mental capacity has increased. It’s likely that any consistent physical training will have the same effect. Not sure how active you are. This wouldn’t be a quick fix though.
I had the good fortune of being coached for a brief period by this guy: https://magazine.wsu.edu/2009/08/11/channel-swimmer/ Having that kind of an example was awesome.
The downside of swimming is trekking out to a pool and finding a time when lap swim lanes are open, and climbing the learning barrier if you’re completely new. In my experience, a lot swimmers also tend to be instinctually quiet, standoffish and very competitive, which can be very intimidating if you’re going for a lap swim as a newbie. Especially if it’s crowded and someone wants to lane share.
But there’s almost always a time slot somewhere when it’s virtually empty, or a friendly lane sharing buddy who’s relatively new/not doing flip turns and stuff, or a friendly expert who’s casual and happy to give learners a wide berth. A local YMCA or one in a neighboring area is usually the most friendly place to start swimming, but I think a decent number of big commercial gyms have pools too, and universities/schools sometimes have public lap swim times as well. And if you’re completely new/never learned to swim, lesson instructors often LOVE private adult lessons because they actually listen/you don’t have to additionally do baby sitting/kid wrangling. I lifeguarded for a bit and taught swimming, and liked teaching kids too, but adults were so much more relaxing.
It’s absolutely worth climbing those barriers. Especially if you get one of these: https://www.underwateraudio.com/products/waterproof-ipod-shu...
I haven’t really checked the landscape post covid, though. I’m guessing a lot of places with pools got hit really hard. All the more reason to get out and find/support one, they’re a really awesome community resource.
Speaking of which, I’ve turned into a stressed out couch potato/haven’t been to a pool since covid, I should take my own advice and get back out there.
Re: Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
#275I don't know you personally but I doubt cognitive decline has anything to do with this. 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…
Personal anecdote: I'm around the same age as OP and until recently also felt like my thinking was slowing down over the years. I went for many years without an exercise habit. About 5 months ago I started lifting weights. The transformation has defied all my expectations and the biggest unexpected benefit is that my mind has become sharper, faster and more focused. I essentially feel like I've reversed a decade's wo…
My theory is that when you're young, your body has a much wider margin for error. A few drinks or sloppy exercise routines never seemed to impact my work. As I've aged, the margin has shrunk, and now there's a measurable effect that I can no longer ignore. Aging is in itself a handicap, but now after too many drinks, the next day both my cognitive sharpness and motivation to even care about shoveling bits around a network have declined.
Now I need to actively stack the deck in my favor, rather that engaging in behaviors that further handicap myself. So that means exercise, a sleep routine, zero alcohol most days of the week, reducing stress, all that goddamn stuff I never had to worry about ;)
Another way to think of it is this: at 40 or 50, can you afford to be lugging around a 20% RHR penalty all day? That will surely come home to roost, probably in the form of atherosclerosis. Remember the most common clinical presentation for a heart attack sufferer is not chest pain, but being dead on arrival.
I bring this up because it's worth nothing that our bodies and minds are remarkably good at covering up problems until far too late. When you get those early warning signals (high RHR, feeling of cognitive decline, etc) trust your body, be proactive, and employ countermeasures.
Re: Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
#276Re: Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
#277Get a doctor visit to start addressing your concerns, like you're determined to fix it. And you mean actively fix it, not make a notation in your record and plan to do another checkup in a year.
If you WFH, make sure don't have CO2 or other air quality problems.
Make sure you're exercising, getting solid sleep on a regular schedule, maybe cutting out caffeine, and maybe ask doctor for nutritionist referral.
Also consider that the problem might be motivation. Maybe you see nothing interesting or worthwhile in porting someone else's hugely complicated API bureaucracy from one language to another.
Re: Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
#278Here's what I did and it seems to help tremendously:
1. Get plenty of sleep.
2. Get fit. As part of this, get your weight down to a health level.
3. Eat right.
4. Get your weight down to a healthy level. I don't know if it's related to circulation or respiratory or what, but my body/mind function better when my body weight is lean.
5. Reduce inputs, such as podcasts, HN, Reddit, etc. Don't stop entirely, but take occasional days or weeks off from one or all of the above.
6. Spend more time doing nothing, being bored, in thought, like we did before the Internet.
7. Be at peace and work on the top 6 the best you can, and forgive yourself when you can't, and get back on track ASAP.
You will fall off the wagon on your goals. Recognize it when you do and immediately forgive yourself and get back on track. Immediately.
Re: Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
#279I started using paper notebook/pencil to go down function call trees.
It helped me immensely.
I am in my late 40s and as another commenter mentioned this could be because we have more responsibilities and not necessarily cognitive decline.
Re: Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
#280Also, being older we have a lot more on our mind. So methods to help organize and focus are more useful than ever to me now. Take notes, keep logs, etc.