Unclear function and possible deprecated?

Hello.
There is something that I do not understand. And maybe someone can explain it to me. My question is made up of two parts.

About the library and the function that is in the following documentation and code, why is it in the added interface, if it is possible to suffer an exploit.

And why is it not trying to implement an example instead of indicating a link?

https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#IERC20-approve-address-uint256-
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol

On the other hand, although I read the documentation, I do not understand the purpose of using it, I have not seen many contracts that use it, if it is obsolete, wouldn't it be better to remove it?

Hi @Cazs. approve is part of the ERC20 standard, this is the main reason we would never remove it. It's a widely used function, essential to the way ERC20 tokens are used. Interacting with a decentralized exchange such as Uniswap, for example, requires the use of approve.

The risk with this function exists but is not really significant, which is why there hasn't been a larger effort to change the standard to remove the function.