In Solidity 0.8 and above, do we still need to explicit define where parameters of a function should be stored?
I have a seen a number of examples that show something like this:
function foo1(string[] memory name) public returns (bool) {
//...
}
function foo2(string[] calldata name) internal pure returns (bool) {
//...
}
function foo3(string[] storage name) external returns (bool) {
//...
}
function foo4(string[] name) external returns (bool) {
// Without defining the storage location to the param, it's works fine too!
}
Is defining the storage location to the parameters of functions still a necessary thing? Or will this be handled by Solidity? It seems like it will still work even if I don't define them.
As far I have read, there are certain types of functions (depending on its modifier) that Solidity will store the parameters at different places. So, I wonder since Solidity is going to do its own thing to the parameters, then what's the point of us still defining them in our code?
If it's still necessary, in what scenarios should I know that I would want to define the storage type for the parameters?