As a software engineer, you naturally have a lot of leverage as a highly sought after, highly-skilled worker. If you end up getting laid off, take the opportunity to use that leverage and seriously think about bettering your future.
Here are the core points:
Related resources: