3 ms·
Having all parameters to be read-only is a deal breaker for me.
by r3m3mb3rm3 9y ago
Having all parameters to be read-only is a deal breaker for me.
- andrewstuart 9y agoThere's got to be a good reason why though?
- r3m3mb3rm3 9y agoHonestly, 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.
- MarkMc 9y agoIt'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.
- r3m3mb3rm3 9y agoI 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.
- j_m_b 9y agoOK now that's weird..