austin-cheney
1. Explain the absence: family emergency/life change, alternate career exploration, education focus, traveled the world, whatever. Just explain it. Surely, you weren’t just sitting there for 4 years doing nothing but watching TV.

2. Tie the experience and learning from those 4 years back into your career focus. You are now a more well rounded developer.

I have taken time away from my job many times. I am part time military so I have time away for professional military education and numerous deployments the other side of the world.

Here is what I have learned from this:

1. Employers love more well rounded employees with advanced experience other developers don’t have. They also fear that you may be absent again in the future. Reassure them.

2. Advanced outside expertise erodes compatibility. Most software developers in the corporate world exist in tight narrow funnels of expertise. That provides them no ability to ask questions like why the fuck are we doing this, because it’s all they know and all they can do. When you ask such questions there will be nothing but friction. At some point you will get tired of repeating stupid when you have learned to bypass it in your other personal adventures.

aristofun
I had somewhat similar experience with ~>7 years gap from last pro software eng. position.

But the job in that gap was still in the same industry (management roles and startups). And big part of startup experience I could pack as hands on software engineering which it actually was.

And it happened not in the middle of a down market.

I still had to spend some time polishing cv and reaching for help, networking, etc. So it took couple months instead of couple weeks as with some of my engineer-engineer friends.

sk11001
What have you been doing in the past four years?
lulznews
Yes just make up something to fill the time.
jononor
Get your CV reviewed by some friends/people in the field. Probably there is room for improvement - generally, not just with what you perceive as the primary weakness.
OutOfHere
I would fill the gap with open source and personal projects that I have worked on. Include sufficient detail. Surely you've been doing something of technical interest in this time. Mark it as self-employed. Good luck.

If you don't have any, then start working on one now, preferably a challenging one, for which you can show impactful results, then go to step 1.