Solidity: quick notes on .transfer() vs .send()
.transfer() vs .send() in Solidity: .send() and .transfer() are methods of the address data type. Their purpose is to transferring value between two addresses on the Ethereum Blockchain. Since, we are communicating with a distributed blockchain and writing to all nodes, it costs gas.
.send() was deprecated because it doesn’t throw an error when the action is not successful. It only returned False. This ends up costing gas without a refund and no state change. Developers were resorting to wrapping the method call in a require() function in order to deal with the issue.
The new .transfer() method fixed this issue and throws an error instead of a False. Although both do not allow for the customization of how much gas can be used (beyond the standard 21,000 gas), there is talk of upgrading .transfer() with this ability.