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.