Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
I 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?
533 comments
[ 5.6 ms ] story [ 420 ms ] threadEither 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.
I account for this in planning. POC -> POC validation -> Finalv2ForReal -> Finalv2ForReal validation
It gives two shakes at a decent solution with some built-in learning. If this looks like too much for business then well I tried I guess I'll do less work for the same amount of money (inevitably the stupid shit that got prioritized goes away). And I documented what I would have done and can point at it when POC as a service is ermmmm ... less than performant.
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.
My smartphone stays at home, on permanent charge (the battery life is severely depleted). I use it only to collect SMS 2FA codes from those organizations that assume that everyone has a smartphone. We call them "mobile phones", but that doesn't mean you have to move if you're using one.
That zombie effect applies equally if you're behind the wheel of a vehicle. Please don't ever do that. Of all tasks, driving is the task that requires the greatest situational awareness.
The longer you're in front of a screen, the more you lose awareness of yourself and what you enjoy. Taking frequent breaks away from screens is important to stay motivated and restore that drive towards meaningful things.
It's sounds wishy-washy how I explained it here, but the video has a more scientific explanation of this phenomenon.
https://youtu.be/zBgCRJluWTc
Your number #1 priority with any port or major refactor is getting the current implementation defined and under test, so any replacement can be tested against the same tests.
Once you've done that you should have a solid foundation and understanding of what the API actually does.
In getting it under test, you'll also build up better mental models of which parts are actually separate and easily testable and which parts aren't.
Then you can get to work replacing and testing each unit, then build them back up on the other side.
> 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.
If I can craft tests up front in terms of the higher level goals then when I finish a subcomponent or get distracted by something else the higher level test is there for me to fall back on to figure out what to do next.
My old company lived and died by its instrumentation of DAU (daily active users). We would try to refactor the code to an IoC pattern with DI but invariably we'd get blamed for a downturn in the numbers - but never lauded if the reverse was true. It was a losing game - we finally had to get management to commit to the modernization (never, ever say "rewrite") and power through the days of low DAU.
The other thought is that maybe it was poorly written, having multiple layers of abstraction, etc. that are unnecessary? Most API's are CRUD operations on data or calling deeper internal things, like payment processing, in which case you are calling other API's essentially.
I would suggest writing external tests that hit the existing API and in small chunks port features over and incrementally get those tests to pass calling NewAPI. Internal/unit test coverage can help to ensure each module or logical grouping is working the same as the prior work too.
Younger me didn't find coding boring - I was still learning things.
Older me, has done a lot of things multiple times. I'm often not learning anything (or, I don't believe I'm going to learn anything).
To be honest, things like Copilot have really helped with this - auto generating boiler plate code removes a lot of the tedium.
2. Some people decline mentally faster then others, sometimes in their 40-50. Don't freak out, but do pay attention, ask others you know to pay attention to you.
3. Take it one layer at a time, and again, write everything down, best on paper.
And keep smiling when it is hard.
No, but we mortals age our brain ability does tend to decline.
For me it works wonders. Wish I started it when I was 17.
in terms of practical advise: more haste, less speed. ive no idea how the code is organised but consider porting it in layers (e.g. data access, business logic, helper functions) as opposed to API endpoints. Layers should roughly be decoupled things with clear interfaces between them. The stuff on the same layer should have the same concern. That way you can go breadth and not depth first and tackle one function at a time. Once you have a mapping at a function level from the old to the new code base it should be easier to plumb the API.
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.
When tracing deep call stacks I can find it helpful to write out the question I am looking for the answer to in a comment. Then I can retrace my thoughts back up the callstack using the very handy shortcut to go back to the previous curson position.
Whiteboard markers are too wide and I am left handed so I erase as a write.
And using paper makes it feel like I am wasting paper.
"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 more in terms of earlier experiences. I see a network of inchoate clouds, instead of the picture-postcard clearness. But I do write better programs."[0]
I can believe the part about better programs. Can you imagine working with somebody who can clearly visualize software with 200 sub-components in it? I once worked with software written by someone who had similar powers. He was a hardware designer. His software had very little organization; he wrote imperatively and remembered where everything was. Six months after he handed a program off to me, I spoke with him and told him I was currently trying to figure out where a particular component was initialized, and he told me exactly where, in what part of what file. IIRC, some hardware registers were being initialized in a procedure that was allocating working space for a numerical part of the program, because that's here he happened to open the log file for the first time, and he wanted the logging from the hardware registers to be the first thing in the log file, before he logged the fact that the memory had been allocated successfully. He remembered this with no hesitation, more than six months after he last touched the code, possibly two years after he made the decision to initialize the hardware in that spot.
Someone with less mental horsepower, like me, has to organize their code into modules with clear names and responsibilities.
[0] https://programmersatwork.wordpress.com/programmers-at-work-...
I am insanely jealous of people who can keep everything in their head. Maybe there's a silver lining in that my methods are more resistant to brain-busting situations, depression, cognitive decline, etc., but I'm not sure that I'm convinced.
I try to lean into just such a silver lining. I like to write my code for worst-case future-me: what would it take for my sleep-deprived, Monday morning, uncaffeinated brain to make sense of? It definitely helps, especially even considering that approach, I often find I overestimate my future ability to understand past code.
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!
For example, write a quick script to add a panic (nonexistantFunction()) as the first line of each function. Then, call each function in turn. Save the panic's function stack trace, then process them as a combined graphviz file.
This simple and efficient hack will get you all the most important edges in most cases for most languages. It won't get you the internal links, for those you need a more effective parser or more exotic means of obtaining branched call stacks.
[0] http://graphviz.org/
Whatever you lose is more than compensated by experience, you spend less time solving the wrong problems.
A bigger issue is the cycles, and the realization that we don't learn much from history. Ignorance is bliss.
You're going to have stretches where you look back and feel like you're doing the best work of your career, and stretches where you worry that you're done for. It's all normal.
If this project isn't clicking with you, but you have to do it anyways, use this as an opportunity to build some "compensatory" habits. A similar situation (I'm older than you, but this happened in my late 30s) got me big-time into note taking, which has been a long-term win.
I'm curious though have you had one or even more than one COVID infection? Brain fog / difficulty concentrating has been known to be a symptom of long term COVID complications. The sooner you identify it as a potential problem the more you can do to work on addressing it with a healthcare professional.
I don't buy for a second that a 40 year old is 'getting old' or that this is normal for your age. I'm 41 and as sharp as ever--I love solving problems and don't struggle with abstractions. Something is up IMHO and it's time to talk to a pro.
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.
This is so true. I'm 37 now, and I'm struggling with that - I'll come up with a project idea, only to second-guess myself whether it's ambitious or innovative enough, and really worth spending the limited time I have available. I end up questioning whether it would really count, or just serve as frivolous self-entertainment.
When I was younger, it was good enough that ideas were interesting or would help me achieve mastery. Once you have a bunch of well-worn skills under your belt and have plenty of options and the ability to make commitments, everything becomes just a function of effort/time and choosing what to do next becomes the biggest challenge.
I'm trying to cut myself some slack and allow myself some amount of time to pursue frivolous ideas. At least you can intentionally combine them with e.g. new implementation technologies (e.g. a new tech stack or new tools) to get important first-hand experience and maintain relevant skills (and therefore decision freedom).
I'm also hoping that some day, having kids might help me with some of these anxieties :-). If I revisit/retread older ground then perhaps to make it accessible to them at home or teach them by doing little projects together and give them a boost and allow the next generation to take it further. I.e., even doing non-innovative stuff could count, as a fundamentals teaching moment for someone else. Hope they take an interest!
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.
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.
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.
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
My major diet change was to eat like the healthiest of the Blue Zone folks. I wanted great energy now and longevity of it and my life. A diet that gives me energy now but leads to heart disease wouldn't cut it.
For that, I went plant based whole grain.
How much you eat matters, too.
A good technical book on diet is The Proof is in the Plants [1]. It covers what we need in our diets and why. For example, how much selenium do we need and what are sources of it. Despite the book title talking about plants it also covers meat and dairy. Everything covered in the book is based on the latest scientific research. It's written by a dietitian who can reference the studies.
[1] https://www.amazon.com/Proof-Plants-science-plant-based-plan...
After a month though my taste buds changed, and I really enjoy the taste of meat and vegetables now.
Yesterday I had the opportunity to eat some vegan ice cream, and I thought I would treat myself to a couple of scoops in a cup thing, and after just 2 bites it was sickly sweet, the amount of sugar made me feel really ill, and it felt like I was eating poison, so I threw it away.
Quite interesting. I do miss some foods (pizza :( ) but the mental clarity alone is worth it.
Plant based whole grain is usually a diet of the real foods themselves. Take a bean burrito that someone makes fresh. Or a stir fry using fresh veggies. So different from processed foods.
I still eat pizza. Love them carbs :)
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?
People plan towards retirement which is usually just looking forwards to not having to work anymore.
People look forward to having children and grand children.
I don't know anyone who looks forward to getting older except for the young.
You don't have to take Responsibility A if you don't want to, but you have to live with the consequences of your decision (good or bad). It's a trade off. I want a house. I make that decision for that responsibility. I now own that responsibility knowing the duties that come with home ownership will take a portion of my time and therefore will reduce the availability of time once given to a different responsibility.
Of course, mistakes will be made, but the best part is you can most often correct mistakes in healthy and meaningful ways.
Such as: owning property, owning car(s), having children, getting married, getting a mortgage, etc.
You can chose to not do any of those things and basically live like you're 20 when you're 80 (in terms of responsibilities).
It's just the mind's way of coming up with problems when there aren't any.
You're damned if you do (give up control) damned if you don't (walk through life unmarried with no kids in an apartment wondering what could've been)
But that's a very sad kind of survivor bias. You were born with your quickness, but you have to earn the experience. Not everyone ends up middle-aged with useful experience. You hear only from the ones who do. And nobody has a time machine.
So look forward to reaping the benefit of experience, but let that be a warning that experience doesn't happen for free. Use your youth to acquire as many lifelong skills as possible. Use those skills in challenging ways to develop judgment. Use your skills and judgment to develop meaningful relationships with people who have chosen similar strategies.
Being able to offer solid skills, judgment, and relationships, rather than the ability to work consecutive 18-hour days, is what you'll have to look forward to.
Responsibilities seem to multiply. And as you age you sometimes find you're not only caring for kids potentially but aging parents. It's a lot.
1 - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4015335/#:~:tex....
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 worth of brain and body aging by going into the gym and lugging some iron around a couple times a week.
Around the same time I started cutting back on alcohol intake and cleaned up my diet a bit. So it could be any of these factors but I think it's a combination of all of them, as you get older, you need to maintain your body or it'll deteriorate and take your mind with it.
This is kind of where I always have been, I find exercise to be a loathsome and boring chore, a necessary evil that gets in the way of things I would rather be doing.
It’s worth it for the global effect on my energy levels and health. But it remains true that for some of us, exercise is never a source of enjoyment, and I understand why many people can’t get through that to do it anyway.
I feel the same way with exercise. People tell me that you feel good after and I never do. People tell me that you feel a "good" soreness in your body and I never do. I just feel sore.
I wonder what's different about people like you and me where we don't enjoy this process the way some other people do? Do you think it's been studied?
The feeling after's nice, though. Would take that in a pill form, for sure.
I wish I felt like this. Exercise is tolerable when I'm doing something at the same time (walking, chatting, listening to music) but that's enjoyment despite the exercise, not because of it.
Reducing, stopping, counteracting mental decline is a holy grail in medicine. I think there has been some progress here.
And on the general mental acuity note there are things like modafinil.
The best things known work are do what you need to do to get good sleep, and find some way to exercise routinely.
It’s probably not possible from a physics standpoint to replace motion induced pumping/diffusion with pure chemistry.
Its possibly people may isolate the two effects separately
But when I had kids it forced me to move and do things. Now I feel better in my '40s than I did in my '30s.
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.
Last year for unrelated reasons I wound up not drinking at all for a few weeks. All of my heart & sleep metrics were improved by large amounts. When I zoom out for the full year view it's obvious immediately when that was in the aggregate data.
In terms of how this knowledge affects my behavior? I'll still tie one on at about the same frequency. But the casual "sure why not, I'll have a beer" is gone. Whenever I'm about to consume alcohol I think about if the amount of enjoyment I'll be receiving is worth the downside & act accordingly.
The other wearable that has had an extreme impact on my lifestyle has been a Dexcom CGM through Levels. I could write pages about this, but in some ways it has been more impactful than anything else. Knowing how your body reacts to particular foods, and seeing the immediate feedback is super eye opening.
And it extends into sleep as well, looking at what your blood glucose does overnight based on stress, exercise, what you ate, when you ate it, it's quite amazing to see how this subsystem in your body is reacting.
I'll never forget the first time I ate sushi (which mentally I thought of as a "light" food, even a snack) only to see my blood glucose rocket past 200 mg/dLf.
You can also see the effect of alcohol here. Not just with carbohydrate heavy beers, but with the fact alcohol itself suppresses your blood glucose levels, since it causes your pancreas to spike insulin, which disposes of glucose. So it's yet another way alcohol causes a disturbance in your body's attempts at homeostasis.
Alas, a CGM through levels is quite pricey because of US healthcare bullshit about giving CGMs to people without a diabetes diagnosis, but doing a month or two of CGM once per year I think it's a great investment (approx $200 for three sensors which last a total of 30 days)
The battery life is very good, I typically get several days to a single charge, which is far better than the Apple Watch. But most importantly it's comfortable to wear during sleep - indeed it takes the majority of its measurements only while you're sleeping. YMMV but there's no way I can wear an Apple Watch to sleep, while the Oura ring works perfectly. I've worn the last two generations of Oura ring and would definitely recommend.
Gen3 app without premium subsciption is very limitied https://youtu.be/c4AVLGwkJHo?t=193
In this recent survey of nootropics [1], weightlifting was better than dozens of chemicals. In fact, it was third only to Dexedrine and Adderall. It scored better than Ritalin! And its variance is tighter than most substances, meaning it's one of the most likely means to improve results for anyone who takes it on.
Personally, I agree. After covid sapped some of my energy, it took about 2-3 months to get back to my average gym sessions and now I feel so much better. Happier, tougher, etc. When I am in shape, the geometry of the world around me changes. A distance or effort I might consider looks, feels, and is more in reach after a few weeks of rows, lunges, pushups, hanging, swinging, light cardio, biking, etc.
[1] https://astralcodexten.substack.com/p/link-troof-on-nootropi...
Make sure you ramp load gradually if you have lifted in the past, your muscle memory can return faster than your connective tissue strength leading to injury risk if you stack the weight aggressively.
This! Dealing with this right now :(
Years ago, I used a trainer in a gym to kickstart a plan, and I found it very useful.
The way I am managing to build my habit: Only do group sessions. If you want to go fast you go alone, but if you want to go far you go together. I know that group sessions are the only thing that give me enough structure to continue.
So maybe it will help you get started as it did for me? Personally I went to a fairly expensive gym so the groups are small. This to minimise risk of injury. Try it if you can afford it.
Start with push-ups. They're fast and require nothing but a flat surface. You can always transition to lifting weights later.
Start today, ideally right now. Seriously. It's your only chance. Tomorrow there'll be an even better reason not to.
Don't worry about initial quantity. You can start with two push-ups, that's fine. It'll take ten seconds if as much.
Repeat every day.
When you feel it got too easy, increment by one starting the following day, not at the moment.
I tried 3 times a week or whatever, and every day you'll find some excuse to push exercising to the morrow.
But doing exactly the same routine every day was key. Then the routine evolves with time, but it's almost always the same routine. I started with a few pushups, then added burpees, then I bought some weights and added a few movements, then I started running 300m a day the first week, and augmented gradually until I ran 42 km every single week.
* I hired a personal trainer. Actually, two of them, scheduled on different days, to reduce the chance that I would saddle myself with a bad one and not know it. After 2 months I let go of the least effective trainer. The trainer(s) were huge at first because having an appointment with someone helped me actually get off my ass and show up, my own willpower alone was always insufficient in the past. They also exposed me to a variety of exercises which is how I learned that I really enjoyed weight lifting (and some other exercises, not so much). Nowadays I just have the one guy once a week doing form checks.
* I joined a very nice gym near my office, again as a motivator. It's easier to attach one habit to another habit, and the habit of going to work is pretty ingrained, so "walk across the street for one more appointment" turned getting into the gym from something hard to something that was basically automatic. My workout is my favorite part of the week now because my gym also has a great jacuzzi and afterwards I get to plop into the jacuzzi, veg out and catch up on podcasts.
* In terms of the "technology" around weight lifting specifically. I'll triple emphasize just hiring a good trainer and just following their instructions at first. But once I started engaging my own brain, I found A) Correct protein/macro intake was bigger than everything else in terms of getting results. Get your daily protein to where it needs to be (which is freakishly high) and same goes for calories (depends on your current body type and intake). B) You don't have to push hard on increasing weight at the beginning at all, nor worry much about how many reps you do, just do what is fun and safe and do it regularly. C) For further education the book Starting Strength and the Fitness Wiki maintained by Reddit's r/fitness are really good. They recommend similar beginner workouts and as an out of shape guy, you can basically start on these immediately as long as you're getting regular form checks and sticking to low weights. (I actually was so weak I had to start with just the bar or even dumbbell variants... once I started pigging out on chicken and whey, that changed very fast, increasing how much I was lifting got easier, and within a couple months I had muscles everywhere.)
Call me a wimp but I find DOMS can be a little distracting haha.
When I do expect DOMS to kick in, I drop weights to 50% my max sets (usually dropping weight vs reps). This makes me "somewhat sore" the following day but no more than that. I also put an emphasis on sleep, "clean" nutrition and supplement with electrolytes. Works really well for me.
As for low intensity cardio, I feel it's good for me, but I have to say it can be a struggle to keep it low. The feeling of "I want to push harder" can sometimes be overwhelming.
Since I retired, I have suffered a cognitive decline; everything takes longer. But, you know, I'm retired, and work expands to fill the time available.
and it just makes me tired. While I'd like to retire and think I'll financially get there sooner or later, I'm afraid that there's an underlying structure to work that I'll miss.
This trend seems genuinely goofy to me. If you have daily reports, standups, or whatever, you're going to be spending a lot of your time prepping for those. That's time that you're not spending writing actual code (or whatever you're nominally supposed to be doing).
It may well be that the OP has other load that has crept up on him; until you take a step back it's often difficult to see what's happened over a period of years.
But burnout is a thing, and sometimes you need to take stock, take a break, and maybe even make some big changes. You're only here once, so it's a good idea to give it your best shot, IMO.
As far as anyone can tell.
in short, that assignment sounds de-motivating, so you're predisposed to notice momentum is hard to establish.
and getting coherent blocks of time, to get in a flow as they say, is the challenge that hits me all the time, and which i didn't have when going to an office 20-35 years earlier (including in college i mean).
Even without burnout, sometimes a problem doesn’t motivate you and therefore you don’t really feel like solving it when there are other things that seem more interesting or more practical.
Either case, once the down period starts it’s a good signal to take some time off and get your head out of it.
On the other hand: When structuring my day with Pomodoros (https://en.wikipedia.org/wiki/Pomodoro_Technique - especially doing the rest properly, meaning just lying down doing some relaxation technique) and resisting all other harmful stuff like (to much) news or (any) social media, I feel like I'm even sharper than in my younger years. Even remembering stuff better.
So, I think those problems are to be spotted in our changing environment and internal setup more than in an aging process. At least not at 40, 50 or 60.
But... when I get on some personal project, I'm on fire. I can learn new languages and concepts and systems and build pretty complex things that people are amazed at.
I think it's more job burn out after years of writing code for other people. You write the code and you work towards the deadline like the world is going to end if you don't make it. Then that code is in production for a year or two. Maybe more if you're lucky, and then it's gone, replaced by some new thing. You stop caring quite as much. But you see these new young kids on fire and working all night and you get imposter syndrome and you try to care and you beat yourself up and think you're losing your touch. tmi?
Listen, there are 60 year olds that look like our long held image of a 60 year that can barely walk or do anything.
And then there are 60 year olds that go to the gym everyday.
How do you want to play this? I don’t accept your premise that 40 has anything to do with it.
Being a miserable fuck is age-agnostic. Trust me, I’m a professional malcontent.
But I like your take. Do everything reasonable to continue forward and maintain your body and mind.
Just don't completly ignore your genetics and biology and be open that they might speak-up and have a say too.
But cognition constantly being under ageist assault has little to no basis when you consider so many knowledge driven professions employ people well past middle age (academia, doctor, lawyers, scientists, writers, artists). They also do their best work much later in life.
They may have a say, but ultimately you can only try to deal with the cards you’ve been dealt. At least I wouldn’t just accept that I’m genetically predisposed to misery with no way out.
There’s an incredibly sad but inspiring documentary called “The Boy Whose Skin Fell Off” about a man named John Kennedy that died of a genetic skin condition called EB at 36. He did everything within his power to make the most of his life, and was brilliantly dedicated to squeezing as much meaning and good as possible out of his horrible situation.
Failure to attempt moving away from and transcending sickness is itself possibly the worst form of sickness, and something that can be easily cured by just having someone genuinely loyal and rooting for you, even if only your inner self. What sick people need most, more than simple compassion and accommodations for their problems, are people genuinely rooting for health/trying to find solutions or grieving the difficulty in finding any.
All adaptation is contextual. This picture is probably familiar to a lot of people, and is a perfect illustration of what I’m talking about: https://www.boredpanda.com/athlete-body-types-comparison-how...
There is no universal “better”. At any age, in any environment, in any physical condition, there are contextually appropriate optimums, and always two categories of direction: 1) using whatever tools are at your disposal to adapt as much as you can while accepting (and testing) limitations 2) ignoring what tools you do and don’t have and either giving up or trying to get the world to adapt to you.
The first direction is always better.
I have a list of passion project ideas. When there's a new hot technology/language I want to learn, I apply it to one of my passion projects and it becomes more directed and focused on a goal and it goes a lot better than just goofing around aimlessly on a new language.
Not everyone agrees with it, but I highly recommend checking out the concept of 'deep work' (and the book of the same name). There's nothing new about the concept, but there's a definitive history of folks who have embraced the uninterrupted time approach that have been successful with it.
It could be that you just need a break or some clever productivity hack etc. Or it could be something serious. Better rule that out first.
If you keep thinking that you can't then you won't.
I recommend you to stop worrying and do the work. In time you will find ways to accomplish your tasks. In any case you can't go buy a new brain so why spend time worrying?
Looking at it differently: Even if a young you had greater mental ability, did young you have the same skills, experience, knowledge etc.?
best of luck to you
But I think the biggest difference comes when I care about something or not. The other day I was reading through the material for the Full ham radio license in the UK because it's about bloody time I got the Full one rather than the lower level. And because I was interested I easily recalled the next day that the impedance of coax used by hams is typically 50 ohm, television feeds typically uses 75 ohm and ladder line is 450 ohm.
If you're doing something that doesn't interest you don't be surprised that your brain isn't interested either! Also, if you have a life then tiredness, worries, stress, etc. all kill your coding vibe.
First 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.