Lurker News
I'm around 40 and recently I have been asked to port an API from one language to another. The code I'm porting is average code, not terrible, but plenty of little things to complain about.

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?

Comments (510) 299 threads

Earlier comments
mrleinad#
It's probably not you, it's just badly structured legacy code, and you're trying to understand it all like you wrote it. Been there, it sucks.

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.

morog#
40 something Dev here. Some things that have worked for me: eat a high fat/protein breakfast with little to no carbs. Stuff like avocado,eggs, sardines,spinach,seeds,nuts,coconut flour; regular exercise (duh); supplement a good omega oil; Lions mane mushroom extract; eliminate distractions;good headphones; daily meditation (TM is a good place to start);use a knowledge manager like obsidian and write everything down in it;always think 'whats a better way to do this' because there is one
bsg75#
Is it possible the teams you work with build unnecessarily complicated or abstracted stuff, because there are more choices of frameworks now? And perhaps the use of those frameworks is attractive for reasons like resume development?

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.

cnees#
I'm in my 20s still, and I wouldn't make much progress on this at all without diagramming or leaving annotations on almost every line of code. Go ahead and do those things. If you don't, you could alternatively invest a hefty chunk of time into reading and absorbing the code so well you don't need to. And if you don't do that either, you're setting yourself up for failure in a way your managers probably protected you from when you were younger and less experienced.

Load more comments