Luckily, I can still program. I didn't loose much mental capacity. But there's a thing in the chronic pain support community called the 'theory of spoons.' In short, you get a certain number of spoons when you wake up in the morning. Some days it's more, some days it's less. You give a spoon out for everything you do and every interaction you have. Most days, you'll run out of spoons midway through the day through normal interaction. But when you run out of spoons, you have nothing to stop yourself from just hurting. You don't have anything to give yourself to stop the pain, much less to give to anyone else to make them feel needed in the relationship you have, to make them feel valued at work, to make them feel happy or welcome to be in your home, to produce something awesome on your side project, to make a healthy dinner ... there just aren't enough spoons on any given day. But the worst part is that you end up in physical pain because you've given out all your spoons, and you know that the people around you are hurting emotionally because you don't have any spoons to give them.
Most people eventually learn to budget their spoons carefully. If you're SUPER cautious about it and you put many of your ambitions aside, you can get to a point where you still have a spoon left by the time you get home at night. But it means you're probably not going to be an astronaut, and you probably are very shallowly involved with your community, and you probably aren't going to leave much of a mark on the world outside of the people who love you. Recognizing that early in life is pretty important so that you do have people who love you.