Hare's a very good resource regarding you question: http://mindprod.com/jgloss/unmain.html.
It works for me! No way I'm getting laid off, it will take years for a good programmer to understand the mysterious ways our system works. Although, I can't really take credit for it, I even made it a less of a mud-ball it was.
Other option, that should work, if you have sensible management - be a better programmer than the other employees.