3 ms·
It's not so much the multiple return as it is losing track of what and where state is being changed. The most common one I see is "populateList(ref myList)", fr
by flukus 10y ago
It's not so much the multiple return as it is losing track of what and where state is being changed. The most common one I see is "populateList(ref myList)", from the callers side you have no idea if a new list is being created or just appended to, you don't know if the list has to be initialized or not, etc. Returning a new list and having the caller specify the assignment is much better.
Just yesterday I fixed a threading bug caused by some semantics around passing by reference and locking.