The use of
callcodeis discouraged and will be removed in the future.
But in what reason is using
CALLCODE EVM opcode also discouraged?
delegatecall is in favor of callcode, whose bug is fixed by delegatecall.
Delegatecall and Callcode are very low-level functions and should only be used as a last resort as they break the type-safety of Solidity.
All these functions are low-level functions and should be used with care. Specifically, any unknown contract might be malicious and if you call it, you hand over control to that contract which could in turn call back into your contract, so be prepared for changes to your state variables when the call returns.