Does modifying objects passed in to functions modify original object?
As per title, ran this across various languages. Results are mixed, but IMHO, it seems unsafe to design your functions/methods this way. It would be better to pass in the object, compute the changes without modifying the object, return the computed changes and assign it back to the original variable. Below are sample code snippets …
Continue reading “Does modifying objects passed in to functions modify original object?”