Closed mohitanand001 closed 6 years ago
Short answer: no, let's keep things functional.
Long answer: In this instance, the result is a new container which is created in the function, you'd only be passing an empty container to fill it out, no real gain in memory performance.
Also, I'd say that you want to stay away from that old C-style of coding and we should stick to a more functional style of programming.
If we have methods that cause the container parameters to mutate, we should then do so, but you already know that the input parameter will be mutated, so you know in advance it's the output.
Another benefit to keeping the method interfaces functional is that we can have versions of the functions that take variadic parameters.
@gubatron @Gotham13121997 Since passing containers around is expensive (and we want to minimize it), but required in some functions, shall we have an option like
where result would be a container passed by the user, which can have the final result inside it.