Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
596 pointsI feel like my past self could have handled this task, but I am really struggling. Porting this API will require a deep understanding of the existing API, which, of course, has several layers of abstraction.
I can't seem to hold more than about 2 levels of call stack in my head. There's the entry point function which calls other functions, which call other functions, which call other functions, etc. You know how it is, code calls other code, and logically it forms a tree of calls and return values that often goes several layers deep. I struggle to hold more than about 2 levels of this call stack in my head. By the time I'm down in the weeds I've forgotten what I'm doing, what the purpose of the actual API call is.
I don't know how to break this into small enough chunks that I can understand it or make progress on. Imagine I gave you the code for the sha512 algorithm, and a hash, and asked you to find the pre-image (the input). This is how I feel. Where do I even get started? How do I find even a single chunk of manageable work to break off.
The hard part is, several other developers are making progress on porting this API. Why can't I? What happened?
I don't know if this task is just an especially bad fit for me, or if my mental abilities are declining?
Comments (510) 299 threads
Earlier commentsNo 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
All comments shown.
Couldn't load more comments. Check your connection and try again.