DEV Community

Discussion on: Should function arguments be reassignable or mutable?

Collapse
 
bgadrian profile image
Adrian B.G.

I like the languages where you can specify, and communicate your intention (using pointers, or in your example mutable == I will modify your value). If I had to choose I will clearly put default as read only, the side effects are the root cause of many bugs, and is not intuitive in most of the cases ( a function effect is the return result, not modifying the Input data).