Hacker News new | ask | show | jobs
by r3m3mb3rm3 3326 days ago
Honestly, I can't think of anything that is not bullshit. Having to declare a new variable for each parameter that you need to manipulate makes the code a lot messier.
1 comments

It's a trade-off. Yes, the code is messier for the 20% of functions where the input is manipulated. For the remaining 80% it makes it slightly easier to analyse the behaviour of the function.
I understand that. But I think it's better to let the programmer decide whether their parameters are mutable or not. Then you don't have to compromise.