Work for yourself, not for your employer. Your employer will fire you the second it is profitable for them, that's how it is.
It doesn't mean that you have to hate your job. Just stop and reflect from time to time, and make sure you are being compensated for what you do. If not, you need to change something (ask for a raise, look for another job, work less, ...).
As developers, IMHO you should always push for open sourcing as much as you can, ideally with a copyleft license and no CLA. Because it is beneficial for you personally: it means that you can reuse your code after you leave, and if you manage to make it copyleft and accept external contributions, it will force your employer to keep distributing the sources after you leave.
I really don't get why developers sometimes go out of their way to help their employer keep their code proprietary, it should be the other way round.
It doesn't mean that you have to hate your job. Just stop and reflect from time to time, and make sure you are being compensated for what you do. If not, you need to change something (ask for a raise, look for another job, work less, ...).
As developers, IMHO you should always push for open sourcing as much as you can, ideally with a copyleft license and no CLA. Because it is beneficial for you personally: it means that you can reuse your code after you leave, and if you manage to make it copyleft and accept external contributions, it will force your employer to keep distributing the sources after you leave.
I really don't get why developers sometimes go out of their way to help their employer keep their code proprietary, it should be the other way round.