There's a few conflicting things here. One is that you fire an employee then moment it becomes obvious they will have to be fired, so a firing should be quick. Another is that performance problems should be addressed - an employee should know if their current performance is not acceptable. Finally, you don't want an employee (especially programmers) to know that they will be fired, or they attack you from within.
Of course, it does seem like management was very passive-aggressive here. Not good.
A quick edit - I HATE the term "passive-aggressive". All usually means (in the workplace) is "not actually doing their job until a crisis hits".
I should have qualified my statement to performance problems rather than HR violations. Agree, if you are doing your work poorly, it is either because you are never going to be good at it or because the company hasn't set you up to succeed. In most cases, the manager and the employee should know in advance that there are opportunities for improvement.
Fortunately, the author doesn't say why she was fired. This allows us to wonder if she was fired for having sex in the supply closet or doing oxy off her company-issued tablet, which is a terminable offense at most places of employment. If this is the case, immediate sacking is appropriate. Not that I, as a manager, would terminate her, though. I'm a fun manager.
Of course, it does seem like management was very passive-aggressive here. Not good.
A quick edit - I HATE the term "passive-aggressive". All usually means (in the workplace) is "not actually doing their job until a crisis hits".