Stories now making the rounds that Microsoft will lay off up to 15% of its workforce in the coming year made me think about my own experiences.
There is both great pain and great opportunity in being on the receiving end which is not always obvious when the boot hits your ass.
I've been laid off 3 times in my 33 years of being a programmer, including my current job where my end date will be the end of August.
The first layoff was a bit over 10 years ago when I worked for a consulting firm that was a US subsidiary of a non-US company. Two weeks prior the new CIO of the parent company had come to us and gave a speech in which he reiterated that there would be no layoffs (a sure sign there would be). So it wasn't a complete shock when some of us got the ax, though it was immediate. Half of the US employees were let go. Bizarrely the CIO then flew the rest of the employees to the US division HQ in Florida for 3 days of fun and games. Two months later he closed all the US offices and everyone was laid off. No fun in that odd game.
The second time was more surprising, but it was a battle between offices in two different cities (the company was a merger of supposed equals) and I happened to be in the "losing" office. A number of us were let go in ones and twos. This was no fun at all.
This 3rd time was a long, long process. Our parent company (for reasons that made perfect sense to them) turned us into a marketing only brand, and made a deal for all technology and product to come from what had been a big competitor, now partner. So 90% worldwide were laid off over a year's time, with me being at the end, leaving only marketing and support. From the parent's perspective they traded revenue for profit, by eliminating a huge number of people, and it seems to be working as far as I can tell. Going from company meetings with hundreds of people to tens was rather painful.
Being on the losing end is never pleasant, but as layoffs go this last one was pretty good at least for me. The middle one was painful, the CTO who had to deliver the news was apologetic and the HR person was completely embarrassed to have to be there but they understood they were on the losing end in a battle where they had no power. Both left or were laid off eventually as well (I don't know which). The first layoff was an unpleasant new sensation but since everyone got the same treatment it wasn't terrible.
The real key to thinking about your own layoff is to not take it personally. Generally it's a business decision, right or wrong, that upper management has had to make because the business isn't going in the right direction, or too many overlapping jobs exist, or it's something that doesn't mesh with being a successful company. Of course it doesn't always work and sometimes the problems they are trying to fix by layoffs aren't affected and a death spiral takes place.
I remember once buying a stock (don't ask me why) of a merger between two big consulting firms given the name of MarchFirst or something. They had around 10,000 consultants. By the following year or so they had 0 and were out of business. I can just imagine the layoff process there; the people doing it might have been the only successful group in the company.
Of course it it's just a partial layoff, someone decided you were not useful enough to keep and some other people were deemed better. It's not hard to feel like crap but again you shouldn't take it personally even if you think it was. It's part of the modern workplace. You might be good at yin but the company now needs more of yang. The company might have bought way too many companies for too much money and now they have to find a way to make it work, so your "contribution" is to leave. Often the reason for mass layoffs is prior dumb decisions by upper management; they get a golden parachute and you get a rock. You might have been an awesome employee but you didn't have any input into the idiocy that ultimately resulted in your demise.
It could also be that you simply didn't have the skills that were required for your job, or the job changed into something and you had no opportunity to learn the new one. This always bothered my mother, who couldn't understand why companies were so quick to eliminate people instead of retraining them into a new position. Layoffs are far less common in Germany where she grew up since the requirements for eliminating employees are very expensive and can require months of notice. Contrast to my second layoff where it was "go home" (with severance of course).
In the end working in a modern economy does require the chance of losing your job which can be very painful if the market for your abilities is weak or the economy is down. My employer at the end of the Dotcom era went out of business at 4:30PM on a Thursday afternoon just about 13 years ago to the day. I had a hard time find a job since everyone got hammered at the same time. Even though this was not a layoff per se and of course there was no severance (I was actually owed a whole months wages I never got) but the feeling is similar.
You could imagine a union situation where your job is "protected" but it isn't an easy situation either. If the employer can't manage the workforce enough to keep profitable and continuing, you might wind up like I did 13 years ago with nothing. Unless you work for the government (usually) any business can wind up in a situation, by its own doing or not, where people have to be let go.
Sometimes getting rid of people does make the company get better, if the previous management had the wrong people or the wrong products or were simply stupid about everything. Apple is a famous example that I happened to experienced briefly during the Spindler to Amelio transition. Everything they were doing was wrong, and I left thinking the end was coming. Then Steve.
The best thing for you before any layoff even happens is to ensure what you are doing would be in demand elsewhere. I remember working ten years ago at a place where some 4GL AS/400 programmers told me that "we don't need to learn anything new as our tools are so perfect we will always have a job." Of course the tool was abandoned and they were laid off or become non-programmers. Today it's your responsibility to stay current and relevant and hirable, as I covered in Your Progress As A Programmer Is All Up To You.
So stay sharp and prepared before a layoff happens and never assume any job is "safe". When the layoff hits you don't get angry but view it as an opportunity to succeed elsewhere. It happens to everyone eventually. I've always thought that the greatest engine of startup creation is layoffs!