I hardly ever use shift like this, preferring instead the more readable argument copying:
sub PaintHouse {
my ($house, $color) = @_;
...I hardly ever use shift like this, preferring instead the more readable argument copying:
sub PaintHouse {
my ($house, $color) = @_;
...I'm sure he thought he was making his functions easier to reuse in different contexts but in practice the actual result is that it's impossible to modify any of those functions without considering _every possible_ combination of parameters that could be passed in. Often what should be a simple fix becomes something much more time consuming.
There is a place for flexibility in software design, but the parameter list of a function is not one of those places in my opinion.
I tried Go and Typescript and realized that the extra code is really, really worth the security, refactorability and safety.
I now frown on my beloved Python for being so permissive