Pull out headunits were the first generation of anti-theft. But due to size and weight, they really don't exist anymore. Everything is detachable face. As for code lock head units. Well, they may not be able to use it after they steal it, but you are still out a head unit.
For protecting a car's contents, it would be good to invest in a noisy alarm system with a back up battery. This will make it less desireable to smash and grab thieves. But the bottom line is, if someone really wants your stuff, they will get it. Set up as many 'walls' and 'roadblocks' as you can to make it not worth it to them.