596 points · by Buttons840 · 3y ago · 510 comments
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?
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.
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.
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.
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
Where can I obtain this for free energy?
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.
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 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.
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...
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.
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.
* 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.)
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.
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.
Years ago, I used a trainer in a gym to kickstart a plan, and I found it very useful.
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.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....
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.
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?
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.
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).
As somebody who far away from 40, how is one supposed to "look forward" to getting older given this likelihood?
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.
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.
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.
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.
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
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.
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.
So when I get stuck now, I just start writing code like I would have when I was early 20s.
"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.
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)
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.
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).
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.
Good habits and lifestyle changes take time.
The only other option that has worked for me would be drugs like Adderall.
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.
This is a really good point. I feel like I'm dealing with way more responsibilities now that I have a house and a family, I'm no longer the center of my own universe.
This seems like a particularly helpful suggestion, both for the original context of the question, but also something I'm likely to use myself. Thanks.
I can still bang out code like nobody's business, even in my late 40's... when I can find 4 uninterrupted hours to get into it. Which is rarely.
It's more about depth of focus, which was so easily available for 10+ hours a day when I was younger.
With family+house responsibilities, I rarely (if ever) have that anymore.
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.
"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!
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.
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.
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.
What I do is log virtually everything I'm doing in an editor window that I keep open all the time (one file per project/task). If I get disturbed by a call or a colleague, I can do a quick recap and get back to where I was. Likewise if I lose the plot several levels down my stack. It also helps if I need to switch projects for a while, or overnight.
It's like a running log of my thought processes:
- Need to add feature x to module y
- What docs have I got?
- How to file in d:\projects\docs...
- Log file from 13/03/2021
- What routines are involved?- a,b,c...
- Looking at A
- I'm thinking of adding a new parameter
- Who else calls this?
- Routine F
- The mod would be straight forward there.
- Routine H
- This is called by S
- This needs more thought, it might be chewy
- What SPs are involved?
- UpdateCustomerTable(CustName, Address1...)
- I've backed up the database to ADB_20230110_1501.BAK so I can test.
What it does for me is offload the requirement to remember the previous levels and lets me concentrate on just the one or two things I'm looking at. As I come back up my stack I re-read what I was planning to do next. I use an editor (UltraEdit) which allows me to collapse things I've dealt with so I can see the wood from the trees.I keep the log files, which go back over 20 years and can be invaluable next time I have to look at the same project months later. Reading the code AND my notes helps me re-build my mental stack much quicker. It also helps with any bugs that I introduce.
Good luck. It is possible to be productive at an advanced age, and still enjoy it too.
So I bought an A4 hardback notebook, and started logging everything I did. I wish I had been doing that since I started in this business; it's a really good work habit.
I keep a lot of journals. Bullet journals for my daily tasks/planning. Long form journals for deep subject matter: maths, graphics, algorithms, etc. Combined with my writing it's definitely been a useful way to see how I've evolved my thinking over time, etc.
Keep at it!
Moving to flat ascii files meant it's searchable and has longevity as it doesn't need any specific tool or app. I can also carry the lot around with me - very useful on site.
Cheers.
Of course, I have a digital file of timestamped and commented code snippets and pieces of config. But that's just about the activity of coding; I now think a handwritten log is a good idea for anyone, whatever their trade.
The reason I recommend a hardback notebook, is because it offers the best CYA protection (I was caned as a child). It's sorta symbolic - hard evidence, if you like.
[Edit] You can also scribble in your notebook in meetings, while glancing furtively over your spectacle rims, to intimidate the speaker. Hard copy is power.
What I suggest for your current situation is to diagram everything. Just buy some big sheets of butcher paper, and draw out the entire nested API structure. Rely on your visual sense so that you don't have to do as many mental gymnastics. Your visual processing center is the GPU of your brain, it has vastly more parallel processing power than the language processing centers of your brain.
Also remember that everyone has different aptitudes. You might not be decreasing cognitively at all, it might just be that this problem doesn't click with you like it does with the other developers.
"Normal" programming involves writing code that will run on one specific thing with (usually) one specific use case using tools (and often whole languages) made for that purpose. Web programming involves writing code that will run on any number of servers/devices/containers in any number of locations/networks using any number of architectures with arbitrary resources of wildly varying quantities and qualities that serves other servers, desktops, mobile devices, embedded things, and who-knows-what else; also of wildly varying quality/resources and quantities with wildly varying and unpredictable workloads/traffic intensity.
In other words, web development is about 100 orders of magnitude greater complexity than "normal" software development. It has become so bad that "premature optimization" is the norm; because the cost of re-doing things later to support a new feature/device/endpoint or fix an issue (e.g. lacking screen reader support) can be so great that adding a dozen layers of complexity to writing and deploying your code at the start can feel like a bargain in comparison.
Video games? Mission-critical real-time embedded code? Operating system development?
I don't want to knock anyone down, but web programming is not the most complex or challenging thing going, it's just software development.
True, it's made more difficult and annoying than it should be, because you need to deal with a jenga-like stack of badly-designed and poorly-documented APIs, forced to use languages and systems with inherent flaws, and have your targets constantly shifting due to the latest fad. But then, that's not unique to web dev, it's just worse.
The web is not just for websites anymore, it's a universal platform for app distribution. This means web apps can instantly be made available to billions of users. You noticed that yourself. This brings all kinds of complexity that these layers solve. They absorb complexity, not add it. So I don't understand why you would say things have gotten "bad". Things were way worse, but individial contributors never noticed.
True, until there's a bug in abstraction level 6 caused by an upstream change in proprietary abstraction level 3 that's been patched in abstraction level 8, but not for your specific case. Then it becomes complex.
I am interested in your experience and why you think this? It's not true at all from my experience. In the past, making a basic message board would have been pretty difficult. Now it can be done in days. Same with Twitter clones etc.
What type of basic website takes months to develop?
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.
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.
> 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.
The difference is that our younger selves were maybe more optimistic and naive and probably would have just produced a new mess for the next one to scratch his/her head about.
Abstraction is hard and we usually have to much of it in our code bases. You have to break it down and isolate smaller tasks to get started with. Start with some endpoint of the API and try to understand what it exactly does. Usually there also should be an API spec where the ins and outs are defined. Maybe it is easier for you to write this code by adhering to the spec and/or fulfilling existing tests than reading the old convoluted code?!
Probably you know all this and maybe you just hate your task. If this is the case.. sometimes a change is what you need.
This needs to be highlighted!
The point is, even if you live a perfectly healthy life with the perfect diet, exercise, and rest, it’s possible that something else is out of kilter and may need serious intervention.
Maybe try a max exertion test for post exertional malaise.
I do think they should be OTC. When I faced the roadblock of not being able to get the medicine I wanted I did go to black market and would do it again in a heartbeat.
1. Illegal drugs
2. Being a head trapped in a jar, hated by all
3. A bullet
The psychs practically beg you to do it. I was just told to give up ever having a professional career.Why is nobody talking about this outrageous conduct?
If you mention these concerns, they will suddenly discharge you, and/or treat you like garbage.
All we're doing is creating pipelines to prison. The industry has no problem sending ill people to prison forever. Not only that but droves of people are dying because of these policies.
I'm shopping for a new one, but their initial intake forms are immediately confrontational, and this is someone that seems to have good reviews... I went through several that seemed to have good reputations, and none were taking patients.
I'm telling you this because I don't think it's you necessarily, but that more and more there are codebases that are dense with this kind of thick obfuscating abstraction.
I dropped out of IT when I was 52. I'm 55 now and don't think I could keep up with the constant myriad changes in literally all aspects of tech. Change for change sake is a scourge that lots of companies fall prey to in the name of keeping up which feels to older developers like chasing the rainbow that is just over the next hill...
Reminds me of "The grug brained developer" :)
1. Covid. My number came up in September 2022. The mental fog is real and is not what generally people think it is. For me it surfaced as diminished short term memory (example, write down a phone number you see one a website. Before covid, it’d take one or two looks. After covid 3-4 looks back and forth. Hand in hand with this - affected executive functioning. In other words, you just feel dumber lol
2. Burn out. It starts with lack of energy, low executive functioning and progresses into depression and/or anxiety. If this applies to you - get help. Make changes. This one you can fix.
Somewhat related, 41 was the age I realized I don’t want to drink again. Some people have this moment earlier, some never. 1.5years later, the feeling is freeing and awesome. I was not a heavy drinker before but lately I was less and less enjoyable with more hangover (and irritability) the next day.
Decades ago the whole MSDOS machine was mine and my tools were an editor, C compiler and linker. Now you need to know a much larger number tools, frameworks and environments before you write a single line of code.
My brother, who's 18 months my junior and a developer like me, shares the same sentiment: "It's like I used to have 20 registers, and now I'm down to 12".
It's comforting to believe that age hasn't diminished us, but working directly with my juniors has disabused me of that notion.
I feel that Tennyson put it best when he said, "Though we are not now the strength which in old days moved earth and heaven, that which we are, we are."
Couple of solutions:
- Wider screen (I use 50' oled), and the VS Code pin feature, you basically order the tabs to follow the code.
- Note taking support by using nested bullet points, a.k.a outliners, it could be a simple markdown file, Notion, Roam Research, Obsidian ... Then you write what calls what for what reason, and make it kind of nested story.
- Favourite panel in VS Code, rather than seeing the whole tree of files, you can favourite the same files you are pinning, to come back later on, you can have favourite groups by feature if IRC, this might be an extension and not built in.
On the health side, disclaimer: I'm not a Physician!:
- Do you have old injuries that hurt? I'm using my injuries to know when my diet is causing inflammation, I try eating in different ways until the pain goes away, I bet it affects cognitive performance too.
- Mentally having "too many windows open" like the computer decreases our performance, this is worries, fears, stress. Try to unburden those by talking to someone, or find what other healthy needs your are ignoring, like walking, moving, exercise, contact with nature, playing music, doing something creative, laughing ... sometimes we become one dimensional and that's not good for us.
A way to test if you have lost ability or is just crappy code that does not motivate you to follow, is to talk to someone that speaks a lot with side stories, and then see if you can follow all the branches of the conversation and help them coming back to the original branch, if you are able to do so, might give you more confidence. This of course requires to be present, really listening, which is a skill in itself.
And the last advice, would be to implement some kind of meditative practice, and walk long distances while you listen to Andrew Huberman podcast.
Look at your IDE, desktop, editor, OS, monitor, chair, etc. and see how you could improve it with new options. Tech or otherwise...
Is your desk a space of zen? Got a plant on your desk?
To me, it sounds like you are placing too high an expectation on your own cognitive ability, and not spending enough time sleeping. Any project that requires someone to do 4D chess in their heads to complete it is too complicated and no one will be able to maintain it. Start writing stuff down and making diagrams until the design is easier to understand. You are trying to build a city in your head without creating a plan.
Even a back of the napkin drawing can be enough really. Sometimes flaws become obvious when we do this. The value of older developers is they have the patience to do stuff like this, while all the young'uns go winging off on wild projects that they have to re-write in a month.
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.
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.
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.
Maybe you can pair with one of the other developers? If they are junior, they could benefit from your experience and insight and you could benefit from their focus and ability to navigate the massive codebase.
Other things you can try (work for me): getting comfy in a small and cozy room, turning the lights off or putting in noise cancelling headphones. Move the phone away and turn off any notifications. Better yet, have a dedicated machine for coding with no logged in accounts.
Ome last thing, you may have undiagnosed ADHD. Mine became progressively worse in early 30s. Self medicating through caffeine no longer worked for me. The doses that were effective were making me severely anxious and sometimes nauseous. ADHD meds have removed the negative side effects of caffeine and helped me feel a little more normal.
Sorry about the long comment: there’s a lot I can share from my perspective, but I don’t know if any of it helps. Feel free to comment back if you’re interested in touching base.
Get a blank sheet of paper and a writing utensil. Not a text editor.
Start at the top of your call stack and start making a diagram that resembles a directory tree:
application_code_function(string arg)
library_function()
std_lib_func()
Use arrows, add notes on the side. Whatever helps. Try to get one API call stack.I don't do this often, but it helps especially when I'm not familiar with the patterns used in the project, or I'm having a groggy day and having trouble thinking "deep". It seems to help to me to try and reason about it away from the distractions of the IDE and the OS.
[0] "Memory Diagrams: A Consistent Approach Across Concepts and Languages", Toby Dragon and Paul E. Dickson
I found that I was much more interested in how the work impacted customers, how we could work more effectively as a team, building relationships across the company I am at, etc.
At 48 I switched from programming to managing. It was a good move for me. I don’t love managing the way I once loved programming, but I periodically reassess and realize that although it’s fun to take a day and write some code here and there, I would be pretty miserable if I were to go back to it full time. I would constantly have to find ways to motivate myself to get anything done.
I do still take those days sometimes and write code for our product, but keep myself off the critical path at all times.
Management may or may not be for you, but it’s something you may want to consider. I wish I had moved over sooner.
As an aside, I had read in my twenties about a theory that claimed something happens physically in our brains as we age that explains this phenomenon of greater interest in the big picture and less interest in detail-oriented work but I have never gone back and tried to confirm or learn more about that theory.
That said, I still managed to pull out a few nights of programming (the Synacor Challenge) and debugging, occasionally till 2AM while I barely get much sleep because we are trying to ditch the pacifier.
I have a feeling that humans can still burn extra mental energy when really driven, to certain limit. But in 40s we are driven by far fewer things than in 20s, and we need more rest for these burns. The up side is I know ourselves better now than in our 20s so I can at least achieve something. Back when I was in my 20s I spent most of the time playing games and failed to learn anything properly.
D-Vitamin supplements, ZMA (Zinc, Magnesium), Enough sleep, No coffeein after 3-4, lifting weights and endurance training (crossfit), eat whole food which you prepare yourself with focus on proteins and fats from animals.
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.
Like you, I'm faced with a couple of APIs that I have to understand. In my case, they are third-party SAAS APIs that I need to evaluate as integration targets for a product I work on.
The odds are very low that I'm going to learn anything of lasting technical value from these APIs. Two years from now, I will probably have to wrack my brain to remember if I ever worked with them directly or just heard about them second-hand.
The same is true of most of the programming I do, especially if I do it well. The alternative is to become one of those toxic senior developers who feel entitled to novelty at work and find ways to make simple problems technically stimulating for themselves, and simultaneously unapproachable for many of their teammates.
How do you stay engaged? You have to remember that you can always solve these problems better than you ever have before. Your solution can be more transparent, cheaper to operate, approachable for new devs, easier to hack on without breaking it, better-documented. You can challenge yourself to finish it quickly or to involve junior devs in its development in a way that is constructive to their growth.
If you don't care about making your solution better in those ways, if you only care about solving little puzzles in code, then you will get bored, because you will look at new projects and know that you can solve all the little puzzles in them, and you won't learn anything fundamentally new in the process.
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.
I've found I need to stop comparing myself to my late twenties self and understand that my burdens are different and I need to set different expectations of myself. As my responsibilities and noise/interference have grown, my ability to do complex design/development has been inversely effected and waned significantly and _that's ok_. I need better tools and to be better at managing my time and energies to be more targeted/specific and I am much more effective than I was all those years ago. I just have to be more intentional and forgiving of myself.
Also you get those nagging feelings of futility about doing a mechanical task (translating an API) when you know you (or anything else) will 1) make mistakes and 2) have to do it again in five years anyway.
There are two times you buy a motorcycle - First when you know you can't die and Second when you don't care if you do. Sucks to be in the middle (aged).
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.
For me it works wonders. Wish I started it when I was 17.
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.
- If you drink, curtail it. - Diet is everything. - Get more sleep. - Get quality exercise. - Find another hobby that is interesting but relaxing, but don't try to turn it into a side hustle. (I restore old guitars)
My recommendation? Focus on tooling. See if you can create a better test infrastructure, a better developer experience for the others. Do you see another way the code can be organized to make it easier to reason about? Is documentation/code-comments lacking? Perhaps your time can be leveraged to help the others. Maybe that perspective shift can unlock your super-powers.
There could be so many possibilities I'd explore before cognitive decline (at 40??)
1. You are not communicating well enough with team lead / members to get ahead on the task. Maybe they have good advice/feedback that you're not getting because communication is off.
2. You are a bit burned out
3. You ran into some difficulty with this hard task and drove yourself into a state of panic. This panic can feed onto itself and prohibit you from making any progress in a reinforcing loop. Now you're in such anxiety you can barely focus on anything.
4. You're not attacking the problem right. Maybe you can use debug messages, or a debugger, or write diagrams, or a small POC, whatever it is you're doing now maybe you can make some adjustment on how you're trying to solve it.
5. You're not taking care of the basics - sleep, nutrition, exercise. This will basically harm you in countless ways, don't do this.
For example, one of the best developers on my team (a little bit older than me) is "on the spectrum". We've worked together for nearly 20 years, starting at about the same time. Early in our career, we would dig into the details of APIs and patterns and be able to rattle off the details of the changes when a new dot release of an library came out.
As the years have gone on, I've "lost interest" in the details knowing that I can look them up when I need to and have naturally defaulted to generalizing ideas. That is, rather than knowing that we need to change the third parameter in the function call in FOOBAR 3.2 when we upgrade from FOOBAR 2.9 because the details of the memory management changed, I just know that we use the FOOBAR function because it does a specific task that we need.
The reason I bring up my friend/coworker is that he never generalizes, he gets stuck in the details. He can't design his way out of a paper bag, but he can write thousands of lines of code over the weekend with full unit tests and there's never any bugs. So we make a great team, he's one that has focused and has every detail at the tip of his tongue. But he never sees the big picture.
So I view getting older in software as (over) training AI. My brain works in the generalization route and the more I see, the more connections I make, but I need to "make room" in my brain by not encoding the details. My friend's brain works differently. He encodes details and can keep a deep call stack but at the expense of ever being able to see the big picture.
I guess that's a long way of saying that maybe you shouldn't be so quick to think it's cognitive decline. It could be just that your brain is encoding things differently after seeing so many examples in your career.
I know I'd fail miserably at porting an API now (I've done that when I was younger very efficiently). But I also know that I can bring a much higher level of design and ideas to the team than I could have 20 years ago.
Code is the author's though processes made concrete (in a sense), and some people just think differently, some people are just incompatible. Over the years I've seen some codebases considered good that are easy to follow and I like them, and other codebases considered good that just seem to grind my mental gears even though I can't put my finger on any specific problems with the code.
Good luck and get the sleep you need.
I have an advice: walk daily as much as you can, but no more than two hours, ruminating what is bothering and/or factinates you in your work. Thinking around the exercise time can be very helpful. And walking allows you to think while doing some exercise, which is even more benefitial.
More than two hours of walking may result in more than 12 km of walk, which can be taxing. 5-6 km of walk is OK.
Personally, I also do resistance training and intermittent fasting, but my primary tool is walking and was for a long time.
Right now I am closing the bug that was introduced more than 10 years ago into the system I work with. I have more than four thousands of lines in changeset in more than four hundreds of files, in two unrelated repositories. So I think I am not all that bad at figuring things out.
PS And sleep well! ;)
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. keep it refrigerated. omega3 fatty acids are prone to oxidation at roon temperature and there are no official stadards for it in america)
2. limit carbs to whole foods like sweet potatoes, yucca, potatos
3. cut out all sugar outside of whole unprocessed fruit. (juice doesn't count)
4. have a side of greens with each meal
5. start lifting weights, (triggers release of HGH)
6. choose one day per week to do a 24 hour fast.
after 2 weeks, you'll start to feel your brain come back
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.
Juice might as well be soda when it comes to sugar.
in retrospect i realize that paren could be read two ways. to be clear, I want to iterate that juice doesn't count as an unprocessed fruit.
Avoid juice like the plague!
No matter how good you are, nobody is good enough to port an API like you are saying it, by memorising or thinking 9 levels deep. Humans aren't designed for this kind of tasks.
Instead, you should take steps to understand the parts that compromise the abstractions that make up that API and implement it.
Also have good test coverage from both sides, so you make sure you are implemented something that resembles more like a spec.
What OP is trying to do is quite literally impossible. Not even the best chess players in the world can hold such a big (decision) tree in their heads _at once_. And they might be the most extreme data point we have on this matter.
The way we humans compute needs to be supported by breaking stuff apart and focus on few things at a time on one side, and by abstraction on the other side. Iterating on smaller problems and generalizing the big picture along the way.
Think forest & trees metaphor, or the 7 +/- 2 problem.
Of course as we get older our ability to completely emerge into one task and put all our energy into it generally weakens for a variety of reasons. But there's enough evidence to support the idea that regularly challenging our cognitive ability keeps us sharp and maintains or improves our ability to learn and tackle new things.
What we can't do however is fight our natural limitations and OP seems to try just that.
Additionally, and this might be just as important, this seems to be a very tedious and boring task. The worst tasks are the ones that require a lot of mental effort while also being incredibly boring. It's hard to find a high state of motivation and focus, which contributes to the issue.
My suggestion would be to try to tackle the low hanging fruits first: find the parts of the lowest complexity, try to understand these and get the simplest things done first. This will also restore your confidence.
1. Enough quality sleep. 2. Exercises that involves your legs. Somehow leg muscles help the heart to pump the blood back up, keep enough pressure and circulation in your brain.
I'm 35 and I've already experienced the benefit of those 2 and the negative impact of lack of those 2.
Maybe you could be just rusty about that kind of code?
My area is blessed with parks and cool places to go for a walk, I hope you and OP have something similar.
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.
Give yourself some breathing room and try to move the code towards something simpler. Find some business logic level mental hooks upon which you can take bites out of the existing implementation.
Thats crazy, context matters.
Sometimes software does complex stuff and no, you cannot infinitely simplify and abstract stuff. Complexity needs to be somewhere
For pure coding, I am writing simple functions and precise data types only, and actively avoid all the clever abstractions I used to push for in the past. I won’t argue about any styling or naming conventions - configure an on-save linter and done.
And for APIs I‘ll look exclusively at the given spec/schema/whatever - and only grep through legacy implementation code if I suspect edgecase handling there.
It’s not being unable, more like extremely unwilling to immerse in just another messy code pile.
I can relate to this sentiment over the past few years. The other variables, for me, are that the demands of raising a young family have grown, my day job has shifted into more of a maintenance mode with less latitude for creative development, and my family has recently suffered a tragic loss. During this time, I've been astounded how much more difficult it has seemed to accomplish fairly straightforward tasks compared to just three years ago. So I've also wondered if my mental ability has been on the decline.
Yet, this past year I've had two new interests spring up - one possibly a new career path, the other an avocation - and despite having precious little time to devote to them, I have been finding that I'm learning at a rate that I might never have achieved before - even in my 20s. I've somehow found myself with a "beginner mind" again, and at times I feel like I'm on fire. And I'm in my mid 40s. I can't explain where any of it came from (one path quite literally took off after reading a post on HN!) - it all seems spontaneous.
My little piece of advice is to be aware of these kind of nagging thoughts that take hold in your mind. Ask yourself if they are provably true and, whether true or not, they could cause harm. You never know what's around the corner, so it may behoove you to stay open and keep these nagging thoughts out of the way!
A big difference I find between myself as an engineer now (40s) vs myself in my 20s is that I have the education, experience, and wisdom to appreciate elegance and simplicity. When I was younger I would throw myself at a problem and keep adding code until the program did what I wanted. I could only imagine what people meant by "elegance," and "simplicity." These days I rely more on mathematical reasoning and think about the problem before I start writing code. I feel as though I can finally see that simplicity is not effortless.
Barring very specific health complications, cognitive decline is not a major factor for most people in their 40s.
Most programmers are fooling themselves if they think they can keep the state of more than a handful of variables in their head and detect errors or understand the entire control flow. That's a code smell, a problem, something that should be addressed. After all: if you can't understand the code, and the next person has difficulty as well -- if you need to make a change to it, how do you know that the change you've made is correct? Do you know that this code does what it's supposed to?
* the project I'm on is not "mine". I joined a sub team of ~30 programmers who've been working on a 5 year project. I'm not familiar with the code. this in contrast to previous projects where I was a lead / main contributor. I wrote the initial implementation so I had a very clear view of the structure of the project in my head.
* the project I'm on is not a passion project. I got very luck that most of my career I got to work on things I wanted to work on so I had passion to make them great. my current project I don't feel that. I'm sure part of it is coming in late. I think it's great project but my heart isn't in it the same way it was for many past projects.
As a counter example, I got permission to prototype something on my own for a few weeks. I worked ~80 hours of over time those few weeks because I was so into it and I felt super productive because it was 100% my code that I understood, no waiting for code reviews etc... I appreciate code reviews but compared to prototyping without the feeling a productivity without is incomparable.
* my passion for coding seems to have dwindled. maybe this isn't true given the previous paragraph but coding things I used to spend time exploring I have a hard time working up enthusiasm for like I used to.
I 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.
When I cut glutenous foods from my diet, mental clarity was restored.
NOT saying "gluten-free" is the correct answer. Just saying there could be underlying issues with a symptom of brain fog.
My wife got diagnosed at 42 with sleep apnea, with no prevalent cause (she's not overweight, does not smoke, etc). Turns out it's just her brain that sends the wrong signals to her breathing when she sleeps. It was life changing. She always felt tired and felt like she could not do her job properly. She got a CPAP machine and now she's feeling better than ever.
Slightly tangential, and perhaps abstract, but nevertheless applicable - two counterintuitive ideas that might be helpful:
1. Keats' notion of Negative Capability. We always think of abilities in the positive but often beyond a certain point dealing with the uncertainties is an ability in itself. More at https://www.leadingsapiens.com/developing-negative-capabilit...
2. Maslow's idea of Second Naïveté. Domain mastery can easily turn into increasing cynicism. Have to be on the alert for this. The masters are somehow able to reengage as beginners and push past what others find mundane. More at https://www.leadingsapiens.com/naivete-in-leadership/
TBH I thought all those ads for brain training were a load of BS, but I recently finished reading The Brain that Changes Itself by Norman Doidge, it's an older-ish book at this point but there was a lot of info in there about how the brain works that I didn't know. Neuroscientist Michael Merzenich's https://en.wikipedia.org/wiki/Michael_Merzenich work pioneering brain plasticity with cochlear implants and expanding that research into autism is highlighted at the beginning of the book and it's pretty damn interesting.
BrainHQ was started by Merzenich, and it's cheap. Figured why not give it a shot?
Maybe this will help you too, but I would recommend skipping the intro chapter if you do decide to read it. I almost put it down because the example being given in that chapter was so obviously fake and contrived. But ultimately I am glad that I continued reading it and would recommend it to someone in your situation.
One simple trick that works for me sometimes is to create a "clean room" for the brain: e.g. change work environment and/or isolate for a fixed period pushing all other deadlines further out. Remove the external pressure and allow time to get into flow.
Ofcourse it might be that what you have to do is materially more difficult than previous tasks you handled. Using mental support tools (notes, diagrams etc) might bring it back within reach.
You're having trouble finding the motivation to deeply understand the original API.
So, cheat your brain with busy work:
- find typical use cases (hopefully the original was written around use cases)
- use it in the original language, write toy programs
- look for concepts and symmetry (i.e. open/close, add/remove, handles, whatever) that reduce the cognitive load
- mock a rough translation in the target language (it's not final code, hacky works)
- slowly port your toys
- watch for gaps... wash, rinse, repeat.
In the meantime, sometimes finding something mechanical to pursue that moves the job forward may help.
For example, mocking all API calls in the target language, following the original structure. TDD? Build a tool to make the target API shims?
It takes time to absorb something that's not calling you, but you can get there.
At age 40, there are a lot of responsibilities, and taking care of yourself and your health can get pushed to the side.
Take time to eat healthy and get exercise. It is amazing how much a healthy, fit body invigorates the mind.
Yesterday I realized that a hard-ish problem in my tiny shell script testing library https://github.com/pmarreck/tinytestlib which I had worked on for over a day was completely moot, and ripped it out while facepalming.
Incidentally, I'm looking for work as... well, the above things, although previously I was a solo Elixir dev.
At the downtime I felt like +20 or 30 years older and gone retarded. Can't do any more hard brain work, and felt like I can't do that ever.
But this will pass.
My advice would be to visit your doctor, asks for a general round of blood tests to check everything is okay, B12, liver function, cholesterol, kidneys, etc. Do the lot. If they show something isn't normal then you can focus on dealing with it, but just as importantly, if the results don't show anything you can rule out your physical health as the problem and focus on other potential causes.
I'd place a small wager on learning you have a clean bill of health helping you get out of this slump, or could go a long way to getting your mojo back.
Best of luck!
Also, 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.
For maximum effectiveness, do not try to multi task while doing this. Just think about the problem and let your brain sort it out on its own. Major difference with and without is the lack of tiredness of mind when attacking hard problems. Brain keeps hacking at it till a solution is found.
Of course there were other problems that prevented me from doing that like mental instability. But the whole process took a while. A couple of years.
But the reality is that what you're going through is probably more about a need to optimize for boosted cognitive function/ neuroplasticity / mental performance / healing at the cellular level. It's what a lot of us are dealing with as we approach or welcome the big 4-0 age. Me included.
Supplements, lifestyle modifications and behavioral changes are beneficial to help optimize for enhanced cognitive function. Here are some that have worked for me.
-15-30 min of sunlight + going for a walk every morning -Cold showers (can alternate hot + cold... or even better, 10 min sauna + 1 min cold shower cycles) -NMN/NAD -Creatine -Vitamin D3/K2 -Physical activity/exercise daily -- for me, weekly, it's 3 days of weight training, and 3-4 days of yoga/core work/rebounding/walking/etc. -Meditation/mindfullness -Social interaction (in person!) -Time-restricted eating/intermittent fasting
Hope this helps. It sounds like your programming skills are exactly where they need to be/up to par with industry standards, so focusing on the cognitive/mental performance area should help boost your workflow/output. Good luck! Really enjoyed reading this thread. A lot of gold in here.
First was reducing TV, social media, and just scrolling internet news. Doing those things all day was training my brain to have a 1 second attention span. A vacation, if used to just chill out and do boring things for hours at a time can help snap you out. Your body and mind don’t want to live in that frenetic state so your stress will reduce too.
Diet and exercise is also important in making your body run as it was designed and helping your brain to be in a more relaxed, nourished state that will give you more mental stamina. Exercising first thing in the morning is good, but anytime you find your brain conking out is a good time for a run and often i’ve felt better immediately. Cardio helps me, I don’t know about weight training.
Diet is very important, and if you eat lots of carbs, especially late in the day you probably aren’t sleeping well and you might have high blood sugar that is impacting your ability to concentrate. Reducing carb intake, eating good breakfasts and light dinners, and not eating for several hours before sleeping (go to bed hungry, you will sleep much better and feel better in the morning) can make a big difference. If you work remotely and get drowsy after eating and you can take a nap early in the day, go for it!
Also just doing whatever it takes to calm yourself down and sleep long and deep night after night can help a lot.
At this age it is also a very good idea to get blood work done to see if there is any imbalance which could be affecting your well-being.
Finally, like muscles our brain seems to atrophy over time and strengthen as you use it. If you’ve been coasting for a while and haven’t had a real challenge, it might take a couple of weeks of frustration before you rebuild that mental stamina.
All of these life changes are very difficult to do at first, but once you make the change and feel the effects it becomes a lot easier and you feel so much better. I’ve done everything I mentioned here and gotten back my ability to learn and focus to a similar level as my younger self.
Your mental abilities aren't declining. You've got a lot more going on in your life than you used to.
Do you have a lot of attention draining responsibilities? Do them after your programming time.
Are you a coffee drinker? If so, consider adding green tea to your routine. It will help smooth out the peaks and valleys of coffee.
Are you anxious and stressed? That will be very distracting and lead to feeling overwhelmed. Very counterproductive.
As we age, we become more aware of the limited time left to us to realize our goals in life. Suddenly, projects we take on can't be just about learning something new or advancing our careers, they start to be in competition with other values and dreams. Maybe what you're working on isn't able to supply a sense of purpose. That feeling can be very draining.
When all else fails, focus on what you can do, not what you can't. Get the system running and spend some time with it. Find things in the old code that are interesting to you. There are stories hidden in legacy code. Think about yourself relative to the craft and those that came before you. Ask to sit with the productive members of your team for a bit, just to ride shotgun and spend some time with a colleague. Rediscovering some of the sociability of coding can be very restorative. A spirit of comraderie can be the difference between apathy and enjoyment.
Also, you might not be getting enough physical excercise. Probably the best anti-depressive/stimulant there is.
I'll be 60 in three years, and it's much easier today for me to learn a new programming language, paradigm, API, etc, than it was twenty years ago. The reason is because: I spend a lot of personal time constantly learning new things, specifically focusing on things that seem scary and uncomfortable, not necessarily complex. If you already know Java, learning C# isn't much of a challenge for your brain. But if you've only programmed using Object-Oriented Programming, try a different paradigm entirely, an environment that's very different, including a different text editor.
Too many developers are too focused on sticking with what they know and optimize for learning the least possible. This is good and bad. It doesn't train your brain to deal with change -- very big change.
So if you've never used vim, force yourself to use vim on a project for six months. If you've only used vim, used Emacs. If you only develop on Linux with Tmux for cloud apps, go get yourself a cheap laptop with Windows, install Visual Studio, and try creating a WPF desktop app. or a Mac with an iPhone.
Back to vim. In my day-job I use Visual Studio. I have some side-projects that I work on that are entirely different environments. One is all NodeJS based using VS-Code. The other is Clojure using the repl. A third is using C and VIM, using raw gnu make that I hand-update. I also use both a Mac and Windows every day, which also adds the challenge of different common keyboard shortcuts on each.
So next time you got a problem to solve for yourself, write a commaand-line utility that is useful to you using C and VIM. Take it slow. Spend an few hours a week. You'll find that you'll have to get much better at context-switching, so you have to leave notes for yourself on what you're doing, where you left off, etc., much more than you do now.
The key is to force your brain to be uncomfortable, especially as you get older, even after you retire.
p.s. I seem to recall hearing John Carmack on some podcast talking about things like, where he recreated Wolfenstein 3D in Haskell, or tried using VI (not even VIM) on a project. I'm not sure what his reasons are, but hey if a strategy is good enough for Carmack, ....
> The code I'm porting is average code, not terrible, but plenty of little things to complain about.
There might be a third option: struggling is a signal that API is convoluted. The code might be alright, but the design is bad.
You seem to be focusing a lot on API implementation (how it's done in another language), not the interface (what the API is doing).
Ask yourself: can you easily explain what should happen when each entry point is called?
If you can, why are you so attached to the old implementation? You should write it from scratch without relying on the old code. Old code is there to expose past knowledge (e.g. edge cases you might have missed), but not as a base for new implementation.
If you cannot, then API has a bad design. It might be alright for computers, but not for humans. Obviously accepting that it is bad doesn't solve your problems.
I had a similar case when I was ~28. What worked for me, is having a picture of how I would build it today, if I were to do it from scratch. This picture is usually much simpler and easy to keep in your head. Then, understanding the diffs between old and new design. The diffs essentially are the flaws of the old design, but now they are also the requirements you have to implement (assuming fixing API interface is not an option).
GO TO THE FUCKING DOCTOR!!!
If you're noticing something wrong or different with your body, go to the doctor to rule out something medical. Then continue your investigation. A doctor wouldn't try to diagnose you based on what you've written in your original post, so I wouldn't weight too heavily the opinions of a bunch of NON-DOCTORS with zero skin in the game.
For me - it helps to step away from work. I mean, really step away to the point I completely forget about work. Go play pickleball, take a day trip, hike, swim, camp, try something entirely new that you have never done before (skydiving, SCUBA lessons, cross-country skiing), etc. The goal is to become immersed in your environment to the point it requires a great use of your mental capacity - in a way that is engaging and fun.
Even if I don't feel like stepping away from work and I disagree with myself that the issue is actually becoming too immersed in my work for too long, I have learned to simply default towards leaning on experience and getting away for a while.
By the time I come back to the same problem if I haven't already gathered a good idea as to how to go about it, I will at least have a new perspective; it's a win-win.
Please take care of your mental health, take care of yourself and don't be too hard on yourself. Give yourself a second chance, draw things out, get out of the office, take a break, and come back and approach the problem after you've refreshed yourself!
We only have so much working memory, life at times can take up much of it. No need to try to force our brains to do so much when you can do your thinking on the paper.
Paper notes are also great for being able to get up and come back to a subject. You can get up at any point and come back with a save state of what you were doing, and how you got there.
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.
> I do have memory issues compared with when I was younger, but I've been coding so long that the total set of stuff I know about is huge comparatively. I'm also much less intimidated by technical challenges since I have a lot more techniques I've successfully worked with and I'm more patient with problems.
> I'm definitely not the same programmer as I was in my 20s, I can't do weeks of 12 hour days in front of the computer like I could then, but now I have a much better and more intuitive understanding of what needs to be done, so I waste a lot less time.
https://news.ycombinator.com/item?id=33530972
Older athletes can't compete with younger athletes on pure physicality, so they have to use other skills: intuition, patience and wisdom are three things that come to mind.
You aren't the same programmer you were when you were young.
Good.
Life would be boring if you were.
Maybe the right role for you here is to establish a good, clear test suite for the transformation to ensure that the API transition maintains semantics. That should also teach you the subtleties of the API, making the work easier to deal with.
Another piece of advice I have for people dealing w/ their CPU slowing down is: just go. Hesitation because we aren't as good as we once were kills a lot of older developers productivity and knocks a lot of good developers out of the game. Just go.
If the problem is serious, by all means do see a physician. He should be able to diagnose burnout, if nothing else -- which I believe is the most probable cause. There are many programmers in their fourties and older that do fine. Don't believe the agists.
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.
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!
I think its a problem with the way we write software. I think all code we write should be visualizable at different levels of granularity, and should be able to show data flowing through it inline. We have all these principles about writing good software such as it should be testable, performant, self-documenting...but I would argue the most important thing is that it should be visualizable! And easily debuggable.
---
I would suggest using a visual debugger and an IDE with static call hierarchy features (sometimes called find usages or find all references).
You should think about how you would build it from scratch. Then fit the existing API to your own mental model of how you would build it. Then it will be easier to understand why people did things a certain way. Many times I will see someone's code and wonder why they came up with such a complicated abstraction layer, but then when you build it yourself you see how it comes very naturally. The problem is for most projects you are looking at the end result of someone else's journey of building from scratch and refactoring along the way as needed.
You didn't mention tests. How do you know their 'progress' is actually correct or even good?
I'm presuming the 'several other developers' are younger than you, hence your concern about age. Without some measuring stick to know if what they're doing is correct, you can't tell if they're just doing more work or actually doing it correctly.
> How do I find even a single chunk of manageable work to break off.
How is anyone else finding work to break off? Is this a free for all, or are there any planning sessions to identify things? Without that, you might be overwriting or reworking something someone else already did.
You may want to ask for some pairing with someone else who you think is doing this better/faster than you, and just ask to work with them for a couple hours.
Talking through the problems with someone else might help turn a corner with respect to mental models. How are they reasoning about current code? How are they tracing through the paths? Someone else deep in this problem may be able to come up with language or examples that resonate with you in a way that random HN people can't.
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.?
I just sat down and was typing a much older passphrase despite having used the current one daily for over a year. That was probably the scariest part is that I remember the past few weeks as if I were using a different passphrase than I actually was (down to having typos on my phone that are impossible with my actual passphrase)
Are you depressed? are you burning out? Are you eating well? Are you exercising? Are you disengaged? Are you socially engaged? Are you anxious?
You need to step back from the tasks you’re finding difficult and look at yourself not as a programming machine but as a biological entity with a complex giant dna mutation brain that can easily get thrown off track due to any number of factors. Most likely unless you’re developing some sort of early onset brain disease you are depressed, anxious, burning out, or simply aren’t interested in what you’re doing. By 40 things get complex because the newness of “OMG IM AN ADULT” wears off and just simply working isn’t enough, especially in a task that requires “flow” of intentful mindful engagement.
I suspect you need to step back for a bit and look inside yourself very critically and examine what’s going on. To me it sounds like probably a mixture of all of the above, leading to a growing burnout. My suggestion that worked for my burnout is take up a rigorous practice of vipassana meditation, regular exercise, managed diet, and rigorously constraining work focus to when it’s appropriate and otherwise entirely letting go of the pressure to perform. Then when working not engaging in second guessing your output - we have ups and downs, the important part is enjoying the process of programming. But YMMV, I would start with taking those questions above and asking the people closest to you them and take their answers seriously, see a doctor and explain your challenge, and see a psychologist and explain your challenge, and spend time seeing yourself for who you are not who you think you are.
Good luck!
Here's a verbatim example from my notes that I think is similar to your use-case:
```
* Clones `std::vector<AnyModule> modules_` member variable, defined in `./torch/csrc/api/include/torch/nn/modules/container/any.h`. Its `clone()` method calls the `clone_module()` function of its member variable `std::unique_ptr<AnyModulePlaceholder> content_`. `AnyModulePlaceholder` is defined in `any_module_holder.h`. Its `clone_module()` method calls `clone()` on its `std::shared_ptr<ModuleType> module` member variable. `ModuleType` is some module that has a `forward()` method, i.e. an object of type `Module`. __But,__ it should probably also have `Cloneable`.
```
Just to cover all bases and include external factors, use of Statins could cause reversible cognitive decline (source: https://www.fda.gov/drugs/drug-safety-and-availability/fda-d... )
Statins is a big business for Pharma, and they continue to push these for “managing” high cholesterol. The risks associated with statins is far higher than the benefits obtained from consuming one.
If you are being prescribed Statins, please review these videos
https://nutritionfacts.org/video/are-doctors-misleading-pati...
Disclaimer: I’m NOT a medical professional and this is NOT medical advice
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.
I also had that difficulty when I was a younger developer. The difference now is that the novelty of learning how to program at a professional level, learning a new language, and learning a new framework, isn't there.
Instead, the novelty comes from convincing others not to make the mistakes I would have made 20 years ago; and not making those same mistakes myself.
I was in your shoes, things I'd find frustrating are:
- The original version was working fine; a rewrite just isn't justified.
- Some team members are writing poor quality code, and I just can't convince them to do it right.
- The original version has style / habits that make it fragile or hard to understand.
- The original version has behavior that's generally not understood.
¯\_(ツ)_/¯
p.s. thank you for sharing these concerns - it's brave of you to talk about mental worries in an industry where "smart" is a superpower. Good on you, brother.
Now we may be 40 and find such traces, but this issue is also growing rapidly with younger folks today, as their rate of consumption has further increased in the information jungle.
To forget is human, but occasionally we also tend to forget some crucial info that we sure knew some time ago, and that's when it bugs. This is what motivated me to create a solution for this universal issue, and started developing a system that seamlessly works alongside as a personal extended brain (our own coprocessor) that just cannot forget. If this is something of interest, it'd be great to hear from you (@shrix).
Others have already mentioned this but I think it's important to reiterate sleep quality. I learned I was not getting enough oxygen at night due to congestion when I went to the doctor for problems with tiredness and brain fog. Taking nasacort each night before bed completely changed my life.
I don't know if this would help, but I'm in my later 20's. I didn't actually know how much my mental health played into how I performed, cause I felt fine. I went to a therapist it turns out I've been *redlining* anxiety most of my life I just got used to constantly operating at that level, and I was wondering why I wasn't getting the performance I thought I could give when doing fun non-stressful environments. It just snuck up and built up over years and that became a normal for me.
It may be time for a change. It's probably a programmer's version of a midlife crisis. You notice that your remaining (productive) time is limited and running out quickly. While porting code from one language to another can be fun, I doubt this fun extends to mindlessly porting APIs. Your brain may just be rebelling.
Also try using GitHub Copilot in the unfinished project with all the relevant files loaded into the current project. Then try writing code comments explaining what the following function does. Basically, try supplementing your own human intellect with the machine intelligence. It’s already unbelievably good and is going to get so much better in the next 1-2 years, and then you will already have a head start on how to leverage it to the maximum extent. Good luck!
Today it'd take me much longer, and the end result would be better. This is experience, because I know many of the ways in which a port could go sideways. The way I deal with massive bodies of work would be to handle it in well tested small pieces. If you're having difficulty figuring out how to arrive at these small pieces, then that's the challenge right there. You'll get good at it by working towards it.
I know that, despite my age (44), its not cognitive decline. It's experience and the end result of my work is simply better.
I'm in good health but I do have less energy, like a higher horsepower engine with a smaller tank. I don't have a problem with the tradeoff...
Here'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.
As I've gotten older (and overall more competent) my threshold for novelty / interest has gotten higher. Drudge work, that once might have been fresh for a younger version of myself, now feels repetitive. I already "know how" to do something, since I've done things like it before, and as soon as I sketch out the high level overview in my mind grinding through the implementation bores me. It's simply become harder to find projects I have an interest in.
This manifests in my work. The stuff I find boring/lame I am terrible at - when I sit down to work, my mind wanders.
For me, at least, this feels a lot like school. "I know this already. Or at least, I know the broad strokes enough that I can see how I'd go fill in the gaps. Time to zone out and think about something more interesting."
2) Oxygen: past 30 if you do not exercises or do cardio you will probably pay a price. Everyone is different. 30 mins running will make you feel 10 years younger.
3) You may have more perspective and more distractions. In my 20's I didn't even read the news. Who cares? Now, I 'care' about all of those 'issues' and I'm constantly engaging my mind with those materials and it's a distraction. Even children, colleagues, other responsibilities - those wear on your focus. 'Young me' could just sit there and work and literally not give a thought to anything else! That's a luxury. If you can create a silent work environment without distractions maybe that might help.
One more thing - co2 levels inside room can have significant impact on your mental capacity. So open the windows every morning, lunch and evening.
Get 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.
Sometimes it helps me to open a text doc to use as a “thought stack”. Just a bulleted list of items as I descend into a problem. Whether that’s an actual call stack, or just a yak-shaving exercise, it’s nice to have those first few levels written down so I can get myself back out. It also helps for refreshing the context.
Another strategy I’ve used is to write out the architecture in prose, explaining the pieces and how they relate, stream-of-consciousness style. I find it helps my mind break out of thought loops.
I also notice that my mind recoils at anything that is boring, or that seems relatively pointless, to the point where it’s very hard to get into a flow with work like that. I think that used to be easier to push through.
https://www.sciencealert.com/kids-incredible-learning-may-al...
My theory is simple - kids simply have more time to learn and less other bullshit to deal with. Some years they have practically nothing else but learning, exploring, sleeping, eating and pooping. And not to mention that many of the humans around them actively bring all concepts down to their level (and some use babytalk) to explain them. So yea… an adult doesn’t have any of these advantages.
And thinking of patterns, perhaps that is part of what you are up against. I find that trash code is increasingly hard to sort through. Does the API itself make sense? If not, then maybe you are better off thinking about how it should be written. As a starting point.
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.
How high up there is this on your list of things that you would like to be doing today? I'm guessing it's not very high. It would be pretty low on my list.
Start fiddling with ChatGPT and get it to convert it for you.
You're bored, not brain dead.
Note the science on this is messy. Jaeggi's paper suggested transfer to fluid intelligence, then another paper questioned that, then she wrote a better designed follow up, then another paper questioned that.
Anecdotally I think it worked for me. I personally think the difference in study outcomes may have been driven by differences in how diligently study participants stuck to the regime, or perhaps even how well they understood what they were supposed to do.
A second recommendation is to read John Medina's book 'Brain Rules for ageing well' which has lots of tips for combating cognitive decline.
and also a browser-based versions of Dual-N-Back here:
But I could "see" better. I could see more clearly what was code that was likely to become problematic. I could see what was architecturally "smelly", and what was a better alternative.
Did that change make me less valuable? Or more? I think more.
So you may be feeling the start of that. Maybe you're becoming more valuable than just cranking out a port. Maybe this is a good task for younger you, but no longer a good task for who you are becoming.
And maybe you can talk to your manager about where you could be more valuable.
Are you sleeping well?
Are you doing early time restricted eating? I.e. intermittent fasting
Hows your diet? Any alcohol or nicotine?
Those can have profound effects, and, though not an expert myself, they can be synergistic with each other
Exercise spurs neural growth in the hippocampus, which is key to short term memory
As you age sleep quality naturally deteriorates, starting a rapid decline at around age 45 if I remember correctly. Meanwhile, phsycal activity and sunlight exposure to your eyes during the day improves sleep quality. In addition, time restricted eating can have a powerfull effect on sleep quality
Intermittent fasting also increases neural growth and energy
On diet: Read a book called "Biohack your Brain" by Dr. Kirsten Willeumier
With the experience you have built, you know which problems can occur, which architectures work well, which traps appear in the code you read, ... so when you have to take on something, you may be more interested in turning it around, but it's a tough task, and sometimes not even possible due to your company, so you end up being depressed
On thing I have become good at with time is refactoring, but when I can't do it properly, don't have enough information, not interested by the subject, or the team, I end up mostly giving up.
I think this is kind of being more wise and doing things that matter (to ourselves), instead of just writing some piles of code.
On the converse my primary programming skills have never been sharper. There is a caveat to this. I feel like I am an expert in what I do, which means I am confident in what I know and what I don't know. It also means there is a lot I have unlearned or intentionally avoided because such practices are anti-patterns or decrease productivity. Some of these things I deem "poor choices" are extremely common conventions which may indicate I am only a beginner from the perspective of a less practiced person who cannot live without such "poor choices".
I believe my programming skills are sharp because I am doing things outside of work that nobody else is doing. I have now reduced my OS GUI to a load time of around 165ms in Edge (130ms in Chrome). I saw a code package from Google on Github on the front page of HN either yesterday or the day before describing a means of file transfer cross-os. My personal JavaScript application has been doing that for years. Soon that personal JavaScript application will have a command terminal that executes in a web browser that works on both the local device and remote computers cross OS.
I once read about this in a book. I cannot remember if that was Blink, Outliers, or Good to Great. Performance follows practice, but the practice must be strenuous, such that you are continuously solving ever more challenging problems. Its the difference between a hobbyist whose skills will degrade over time, a professional whose skills are actively maintained but not advancing, and an expert whose skills continue to increase. As an example most senior developers I have met believe they are awesome because they are doing the same things they were doing 5 or more years ago, but now they are so much faster at it. That isn't awesome, its steady state.
Also anecdata but I'm finishing up a project in which the CTO of the company has a good 15 years on you and seems as sharp as ever.
Maybe there were stresses on your body that youth simply helped you handle better until now.
A few quick questions: do you exercise regularly, and specifically, do you go jogging or running? That usually helps a lot.
For me, it was more a case of high blood sugars and poor diet. My head cleared up a lot once I fixed those.
Here's an old favorite of mine: https://youtu.be/7H7id3to1cg
Other tips: intermittent fasting, get rid of dairy / other allergens.
I’ve found that messy or illogical code slows me down more than other developers. On the upside though, I typically write cleaner code than other developers, because that’s the only type of code that I’m comfortable with.
Just accept that not everything is going to fit well with how your brain works and try to get through it.
I recommend taking detailed notes on everything you find and trying to map out on paper the call tree and different classes involved. This can help greatly when dealing with messy code.
For me, I used to be very good at CSS, but I'd always fall apart when needing to actually sit down and write the code. That's largely still true, but haven't really kept up with the css spec that much in recent years.
My memory is totally shot. I think it faded away through years of insomnia, poor diet and lack of exercise. It became harder to live healthily after I had kids.
When I was young, hungry, eager, I would drive fast and take chances, fail fast often, move fast and break things, you get the idea. I would have ripped apart that API and put it back together in record time, paying no attention to any debt I have accrued.
Years of mistakes have earned me the caution necessary to not deliver products that ruin my nights and weekends, disappoint clients, or make my company look incompetent. It sounds like your experience is correctly preventing you from making those mistakes.
It's not age, I was more capable when I retired in 2021 than I was in the 1980s because I found ways to give my brain enough time away (sometimes getting laid off forces you!) and also switching to completely unrelated programming jobs to provide a new perspective. I never completely burned out by giving my brain something new to focus on.
In my experience, certain tasks are not challenging and I really don't want to do them. I have a system for when things get this mundane. A pad of paper, and 3 pens, blue, red and green. I write down the next 5 or so things I need to do to make progress in blue. Really nitty-gritty when needed ('search list for target value', etc) Optionally, if needed, I put a green dot (instruction pointer lol) next to the current line in the list. When the line is complete I joyously scribble over it in red and get to the next thing. Repeat as needed.
When people say X is bad for you, they're usually right. But how bad is it? Will it affect you 5%, 10%, 50%? When you combine many bad things, they'll gang up on you together to make your life hell. They also affect you more the older you get.
Bad things:
* Lack of sleep
* Lack of exercise
* Social media
* Drinking/drugs
* Interruptions
* Unresolved/ongoing family/friends issues
* Bad and/or irregular diet
* Not doing things you like to do.
The feeling you describe using the contrived SHA-512 task, is of total, utter panic and hopelessness, putting it mildly.
I don't know how deep into this you are but it left unchecked it turns into a vicious cycle. Then those bad things mentioned above are more likely to knock on your door and make the problem worse in the long run.
Throughout my career I've sometimes had to use pen and paper to keep track of my thoughts while reverse engineering (which you are doing) or debugging spaghetti. File/Class names with function names and simple diagrams have been very helpful.
I've found out that trying to save time by not setting up a proper debugging environment is a very bad thing. Ideally you should be able to run both old server and old client on your computer. Write a very, very simple client that speaks to the old client.
Add logging and breakpoints to the old API. Step through it and write notes on paper.
Mental abilities declining? I don't know. I've encountered code that I struggled with at any point it my life. Perhaps the other devs know the code better or have had similar experiences. Perhaps you're working on a more difficult part of the code.
I'm guessing this old API was written over a long time. As such it'll have warts and bug fixes that are not trivial to understand. Do you know the language and framework it's written in? If not, write a very simple API in that lang/framework to understand it.
In my case, it was allergies. I discovered that I had gluten allergy (mild) since birth that somehow stayed out of my radar for 28 years. Only after age 28, its side-effects became so apparent that I had to take action, only to find out that it was there all the time.
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.
What surprises me is I learn much faster now than I used to. But I guess it makes sense. I never stopped learning new things (coding or otherwise) so I've learned to learn. I also have more data points to compare new stuff to.
Are you sure the task really requires going three+ levels deep into what the API is doing??! On the surface, being asked to "port the API" sounds more like a request for a work-alike API not a complete redesign, although with the idiom of the target language of course.
I don't think this has anything to do with age! You should be at the top of your game at age 40, if not still improving, but maybe there are personal/stress factors that are affecting you.
That said, if you do not exercise you should really try for a few weeks. Where your body may have been able to coast with normal effort in the past as you get older you need to give it more focused work to get the same level of outcome. Beyond being good for your health exercise is known to have huge impacts on both mental state and acuity.
Another thing you could do is, become the guy who builds all the documentation for the new codebase + unit tests. If you're confirming the two code bases are "exact" you will need a lot of testing.
Days get shorter, winter gets colder, days blur together. Things change. Fortran was way easier... Pfff objects of objects to keep track of.
Remember what your core strengths are... Where the true wisdom is. And always check back to the requirements document.
You have a detailed one right?
Break what you are required to do into smaller components, but from the other side of the problem, systematically. I find by going smaller and smaller I eventually find a manageable chunk that I can start with.
A rainbow attack on the sha512 can often deliver a fast result.
I have to go yell at a cloud now...
Find someone who worked on it and have them explain it to you like you're a 5 year old. If they can't explain it in simple terms, you'll confirm that it's not the piece of cake you thought it was.
I don't dismiss that you might just need some sleep and are overworked, but since you're asking these type of questions, I'd say you're probably fine.
I find in my 50's that my level of patience for gold plating is less than what it was, and I am less _willing_ to wade through layers of cruft when I know through experience there are simpler and more efficient ways to get things done - efficient in both developer and machine time.
Recently, I found out that stressing my body can "reset" my mental and emotional state when I'm in a bad spot (similar to what you described).
I stress my body by doing a physical activity (like running or cycling) or going on a diet (skipping 1 or more lunch). I'm trying to do the opposite of what I feel I want to do (eating more sugar-stuff and doing nothing).
There might be some setup to make it work with any given editor (including vim) but it's worth it because it provides an immediate productivity boost - if you forget where you are, you can 'pop' the stack, check it, then 'push' back down to where you need to be.
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.
Might it be that the people making progress are less interrupted? Also, this sounds like it might be a place where pair programming would be more efficient than two people working alone.
I have recently tried to raise the bar on my designs and being older is definitely a plus. Not only do you have the previous experiences to user as a reference, but the amount of energy you'll need to fit everything in your head means you'll instinctively accept the effort if you feel like it's worth it.
When I use to eat sugar like a madman, I use to feel just like you, so perhaps there could be other factors impacting your mental sharpness.
I have a few questions for you to answer to yourself:
1 - How fit are you? (Cardio and strength) 2 - How is your sleep? 3 - How often do you practice programming / play with greenfield software projects outside of work?
There could be more questions, I am not a specialist, but I have felt just like you described when I use to eat more sugar-based food than I was supposed to.
First factor: having kids (or replace with any other adult stuff). It takes a lot of mental and physical energy I could just use for other things before.
Second factor: As Oscar Wilde said, "I'm not young enough to know everything". Many years ago I would have an opinion, off the hoof, about everything and everything seemed simple. Nowadays I tend to think things are rarely as simple as they appear.
If you do not believe that is a factor then examine your sleep and physical fitness. These things factor a lot more into brain function as we age.
I had to pick up some work using something called OPA open policy agent, horrible. It took 3 senior devs on a call together something like 4 hours and we were all struggling to understand and debug this code. Horrible to work with and understand. It's taken me double the estimated time to work with it.
For your work I'd probably be looking at the requests and responses then trying to fill it all in from there.
Now, after having attended conferences, after having read the books and admired the best codebases, those developed in companies than care and are proud of their DevEx; now you see it for what it is after all, shovelware.
Then pick an easy endpoint and start to implement the code. Follow this through for the rest and add tests as you go. You'll probably want to adjust some of the app structure and maybe do small refractors to help keep things organized when you get there.
Of course some tasks are bored and we don't want to do so we loose focus that doesn't mean mental ability.
You might have some decline in motivation due to other reasons, not least anxiety about aging!
If your colleagues who are enthusiastically porting that API were the same age as you, you would attribute your lack of focus to something else. There is no reason to latch onto age as the explanation.
I 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.
Your glucose metabolism and aerobic fitness start impacting cognition long, long before officially crossing any diagnostic thresholds, and it's usually the middle age where our frequently poor lifestyles start impacting us.
Sounds cliche, but def a list to keep in mind and check off if you haven't. Even just a single 20-30 min workout makes a sea change in cognitive functions
https://tibleiz.net/code-browser/index.html
That said, I am also currently in a hole, can just not look at code. Make yoga, eat healthy, sleep enough, let the sun shine on your head.
Every time I find myself unable to focus beyond a shallow level I invariably find that I've let my mental and physical environment slowly go to shit and I'm running at 1/3 capacity because of it.
It's not that I can't code, it's that work is just making me not want to code. I'd rather put time into playing fighting games while my fingers still work, if anything XD
It's fine to hold no more than 2 levels of call stack in your head. Most devs have a very hard time tracking more than a couple of variables.
What I can tell you: write lots of notes. Break the problem in smaller ones and take notes about the problem itself. You don't need to "hold" anything in memory, write it down.
Get your blood work done.
I know this may seem unrelated, as we often think of testosterone as related solely to muscle development and sex, but it's far, far more. It is very important for cognition, focus, and mood. Further, the estradiol produced from aromatization is highly neuroprotective.
Check your levels, just in case.
From your description, you want to deeply understand the functionality to make better porting, which is what I expect from a senior developer.
Also, this might be a boring project, not triggering any mental reward for accomplishing it.
I would focus on your learning pace for exciting topics to measure mental abilities.
Be especially weary if it becomes difficult to read an analog clock: https://yourdementiatherapist.com/alzheimers-dementia/what-i...
It's WAY easier to just consult your notes than to try to remember everything.
Instead of porting it as-is, rebuild it with the actual functionality required and throw away the overly abstracted parts.
Oh, and I echo the other guy: make sure you have a test harness that validates everything, so you know if you've done it correctly.
Because seriously, you have a couple of decades to go before you hit real physical performance decline (assuming you don't have early onset alzheimer's or something)
I would also point out, that not really giving a fuck is a much more informed position...
It's possible I'm unique, but I don't think so. I wonder if you're just distracted or perhaps experiencing burnout.
maybe it's just because i listened to that podcast last week, but it sounds like you don't have the theory of the api you're porting. by theory i mean an intuition of what the software is, what motivates its existence, what it ought to do. to define the term "theory" by an example from the paper (or possibly from "the concept of mind" by gilbert ryle, referenced by "programming as theory building"): you don't have newton's theory when you can answer a question that he answered the way he answered it, you have newton's theory when your answer to a question he wasn't ever asked is how he would've answered.
so this notion of theory means, first, you can never record a theory. you can't write it all down. to have the theory means you can apply it to any new circumstance that arises, so you can't just write it all down, because you'd be writing forever. a theory is knowing how to respond. the impliction for software is that the code and documentation can't communicate the theory of the software. a theory can't be communicated at all, it has to be acquired.
so how does one acquire a theory? how'd you learn to read? how'd you learn to write? how'd you learn arithmetic? theory transmission is a social function. people with the theory show you, teach you, guide you in forming the theory for yourself.
the conclusion is that software firms should put a lot of effort into retaining people who have the theory of their software, and put a lot of effort into transmitting that theory to new people. that's not the world we live in, is it?
actually, i think that conclusion applies to any business, yet onboarding is terrible everywhere, and workers are treated as interchangeable.
what i'd be asking myself if i were you is who has the theory of this api you're porting, and how much of their time can i get?
1. Sleep quality 2. Nutrition quality 3. Exercise 4. Lifestyle
First make sure that all the above is in check.
Sleep is a game changer in cognitive abilities and it can swing either way.
Had you have COVID? Some people, including myself, have shown long term cognitive effects after it. It took me about 6 months to get back to normal.
This can also be purely psychological. Talk to a doctor!
You can buy sublingual oral B12 supplements OTC if you want to just try and see. The methylcobalamin form seems to work better than cyano FWIW.
I'm sure you will be okay later on because that has nothing to do with your age or cognitive decline.
You can be physically stronger and "brainly" faster and more effective than any man younger than you as long as you keep exercising/coding.
you should try writing things down! Like, keep a notepad around. I have trouble with this sometimes and writing it down reduces the number of things I have to keep in my head.
Changing my diet dramatically, d3/k2 magnesium, Vit e, omega 3s, and blood thinners cleared up my mind.
Also exercise is absolutely critical.
My bet is Vitamin D deficiency - anything below 30 ng/dL is borderline 80 to 100 is best for longevity and cognition.
It doesn't matter if you never look at your notes again, their use is the short time after you write them
Notion or Obsidian work for me.
A point I haven't yet seen in the comments: how much the advancement of civilization owes to 20-30 somethings. Take The Beatles, Alexander Hamiliton, even Anthony Fauci (who had the rare reprise late in life) as examples. At around 40 I gave up any illusion I might do something illustrious, and accepted that from then on, I would just work for a living. My best work became my children, and I'm happy to have done that.
Many of the other comments line up with my own observations at this sage old age:
* more distractions (my house seems to be aging much faster than me, and taking up much more time to maintain)
* bigger responsibilities (more savings to manage with less time until retirement to fix investment errors, offspring where simple existential needs like food and diapers have been replaced by tuition, aging in-laws with real decline issues like eyesight and bad joints)
* less energy. true, and most especially I can't skip sleep like I could 20 or 40 years ago.
* burnout ( this stuff does get old, and "boring" as noted by one commenter)
* underestimating the value of my experience. Not writing that really clever code when a simpler solution will suffice, for example. The ability to tell people a realistic estimate of work, not my old optimistic "couple of days" estimate that was almost always 10x short
* ADD, not helped by social media (stay off it when working, or always) and a trying to ignore the constant stream of news (except HN of course lol). But a great help in being open to new methods where I find myself evangelizing about git to people half my age.
* exercise, fitness, diet: need to up my game after covid isolation and increasingly creakey joints. It does make a difference. In my case living in The Big Easy doesn't help.
* Did I mention sleep? Why yes I did, forgive my forgetfulness....no, actually I put it here intentionally because it is that important. Exercise helps with getting quality sleep.
I am still writing code and I "provide value" (their words) in that I can solve complex data analysis problems that come to me after co-workers reach the limits of using vlookups and pivot tables in Excel. I'm not the fastest and I'm always fighting imposter syndrome, but that's quashed whenever I catch a glimpse of production code written by pricey consultants and realize they make the same mistakes and use truly ugly workarounds even I wouldn't consider.
Try working for 3 weeks without alcohol or coffee intake and see if that makes a difference. Then slowly reapply.
Its not that the older engine is broken but it does require different maintenance.
There might be other questions worth asking.
The inside of my mouth feels constantly cold. So I know I got an issue, but appointment is in march.
The sleep apnea damage is permanent, but you can stop it from getting worse.
Maybe I’m making myself subconciously incapable of doing it.
My personal thinking is that there's a lot of social malaise and hopelessness that's affecting people mentally right now for these and possibly other reasons that's contributing to this mental fog. People are checked out right now.
> Whether you're very scared of Covid or not the least bit scared, everybody is frustrated with still dealing with it and the measures they have to go through.
> Prices of everything are going up, layoffs are happening, and there's a general sense in the air that the economic calamity that's possible is just getting started and there's nothing you can do about the coming bad times.
> For lots of complex reasons, one of the biggest traditional sources of joy (people creating families) has been plummeting and possibly getting worse in this time period.
> Everybody, regardless of political idealogy, has some big topic to feel hopeless about. Some people think the world is ending due to climate change, some people think the world is ending due to Putin, some people think the world is ending due to economic migration, etc. This is subjective, but there's a limited real aspirational message of hope for the future that most could agree with and see unambiguous positivity from.
This describes me (early 40s but I was always like this) so I just write it down in a notebook. There's no advantage in trying to keep everything in head when we can use well tested tools.
As such, do know that porting API is tough in best of times. It's not easy to just walk into it and understand, let alone replicating the functionalities in other language. You are trying to pull off several things at once.
I'll also repo my earlier comment verbatim[1] where I offered my suggestion to someone in similar situation.
It's beneficial to approach learning about an API top-down and bottoms-up. The context in which the API operates and then the working of the API in itself. Imagine if you were in charge of maintaining a hardware tool. I first want to know how this tool is used by various customers before learning how the tool works.
1. Begin by learning all the end-to-end product flows this API is going to be invoked within. This is the context in which your API is operating in. It also sets the stage for non-functional requirements such as latency, and availability requirements. How will end customer and business be impacted if this API were to misbehave?
2. Next speak to all the customers of this API. How do they produce the data for your API's inputs and how do they consume your API's output. You will be surprised by all sorts of creative ways in which an API gets used, not necessarily what the API was intended to begin with. But you need to support all those clients so better get to know their use cases. Also, understand how they handle your API failures. The consumers tend to make unstated assumptions about input/output validations and invariants. It's not documented anywhere but floats around as tribal knowledge. Extract that knowledge and document it somewhere. Make sure you are very clear about every single input parameter, how it's produced and its expected values as well as every single output parameter and how it's consumed. Don't forget about exceptions. Often times customers treat exceptions as just one of the expected output parameters and so actually depend on the API throwing that exception.
3. Finally, take a look at the API's implementation. Don't get frustrated if you don't understand more than 50% of the code. It's perfectly fine. Make notes of the parts that make sense and also note down those questions. Ask around. Often some parts makes absolutely no sense to you. But it is there for a reason, someone as competent as you put it in the first place. Again, ask around both within your team and the API's clients. Pay attention to the API's downstream dependencies and how their failures are handled and bubbled up to your clients. Your API's SLA depends on your downstream APIs, learn about them and ensure that it matches the expectations.
4. You also have indirect consumers of your API who depend on the side effects produced by it. Make sure you learn about them. If this API causes a side effect (such as DB update, publish a message to Kafka) then learn how those side effects are consumed. Does someone depend on it? If yes, how? Though I've described these steps in sequence I find it useful to approach all of them in parallel and over multiple iterations. At first everything is blurry and after first pass you penetrate through about 10% of cloud cover. After 4th or 5th pass you will have a reasonable understanding (~85%) to make small bug fixes.
best of luck to you
My way to improving has been pretty long (10 years of trying) but ... TLDR: I started to be more physically active, including strength training, completely overhauled my circadian – sleep habits (I sleep 10x better than years before). I suggest to follow Peter Attia and read books from David Sinclair, Satchin Panda, Matthew Walker... It pays off. :) Keep going, you can improve your mental abilities again.
PS: Last year I started to learn Clojure (I am not programmer, I just love it as I feel like functional languages are like poetry:). Yes, it is not easy, but I hope my first simple and useful app will be out and public this year. Just for fun.
interesting book to read: https://smile.amazon.com/dp/0316113514
Anyhow, good luck!