This is probably one of those things that varies a lot based on what your field is and how close to academia you stay while in industry. It's going to be a lot harder to come back to doing experimental physics if you spent 5 years as a software engineer.