Hacker News new | ask | show | jobs
by r3m3mb3rm3 3326 days ago
Having all parameters to be read-only is a deal breaker for me.
2 comments

There's got to be a good reason why though?
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.
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.
OK now that's weird..