I just came across this article, and in particular, this answer. Essentially they're talking about returning
self from instance methods to allow for method chaining. That being said, one of the first thoughts that came to mind was, Why not always take instance methods with
void return types and make them return
self instead? The next thought, which came to mind immediately, was, There's probably a reason this isn't more common. So what could be the harm in it?
It seems like there honestly wouldn't be any. The reason is that nothing about the mere existence of a return value implies or even seems to imply the need to use that return value. If the method is a specialized getter or file reader or something, that's one thing, but if people aren't looking to use the return value, they naturally won't pay one any attention. Furthermore it shouldn't be too confusing, because
return this; is pretty trivial; at most, somebody would probably think it's irrelevant. It certainly seems like it wouldn't hurt anything, and it's generally better to have too much than too little.