News for hackers. Stuff that matters.
Re:Copying data is wasteful, mutating data is dangerous by kburman on Thursday January 09, 2020 @03:37PM (#22005416)
I like how ruby way of declaration if a method does mutate object or not but a exclamation mark at end to tell it modifies the object

a = a.sort or a.sort!

Re:Copying data is wasteful, mutating data is dangerous by jonnycomputer on Thursday January 09, 2020 @09:38PM (#22007943)
I like the idea of adding an exclamation or some other mark to the individual parameters in the method declaration since a method might mutate some but not all parameters.
Re:Copying data is wasteful, mutating data is dangerous by mirekrusin on Friday January 10, 2020 @02:01AM (#22008920)
Julia has this pattern as well.