If a method populates/modifies an object, would it be preferable to return the object or to keep the return type as void and the method would modify the Object through its r
It is preferable to modify the object this and leave the arguements unchanged.
this
class ModifiedType { public ModifiedType populate(UnmodifiedType arg) { return this; } // or public void populate(UnmodifiedType arg) { } }
See StringBuilder as an example.