I want to discuss about an issue that I opend before (#1211), for next major release of RxSwift.
Currently, I sometimes feel frustration with code completion, because disposed(by:) and dispose() are so similar and I sometimes make the wrong choice.
I had proposed willBeDisposed(by:) and @kzaher replied that disposed(by:) is shorter and better. I can understand that short names are better, but I still feel small frustration above.
In my opinion, preventing auto-complete collisions of distinct behaviors is very important. I like dispose(by: ) syntax, perhaps .dispose() could be renamed?
Possible alternatives:
.immediateDispose()
.nowDispose()
.shallDispose()
Hi @hiragram ,
I'm not sure this is a good time to discuss this. We've been working all summer on 4.0.0 and I've already refactored all of my code to use disposed(by:).
I think we would need some really good reasons to change this API.
Currently, I sometimes feel frustration with code completion, because disposed(by:) and dispose() are so similar and I sometimes make the wrong choice.
Are you saying that you are choosing wrong option from auto complete dropdown or that you are accidentally compiling code that contains dispose() instead of disposed(by:)?
Are you saying that you are choosing wrong option from auto complete dropdown or that you are accidentally compiling code that contains dispose() instead of disposed(by:)?
It looks like we're describing the Xcode autocomplete's way of ordering symbols.
My guess is, I haven't tried the newer builds of RxSwift, when you intend to use .disposed(by: ) but you're using the autocomplete shortcut .dispo -> _autocomplete modal_ the first entry is .dispose() or vice-versa.
To me, this is a flaw in auto-completion, as it cannot contextually work out which is the higher priority symbol. This might be better as a feature add to Xcode rather than changing RxSwift to appease an inconvenience. Like automatically prioritising symbols that are most recently used.
It's my workaround that typing dd when call suggest of disposed(by:).

I think we should leave the API for now as it is. If we find some compelling reasons to change it in future, we can do so.
TBH I don鈥檛 think confusion is a good reason for API changes. You have sort and sorted which are the mutating and non-mutating counterparts for Sequences, doing very different things and have very similar names.
I agree with kzaher there will need to be an extremely good reason to move away from that naming as it perfectly reflects both Swift鈥檚 API naming and is short and easy.
Most helpful comment
It's my workaround that typing

ddwhen call suggest ofdisposed(by:).