On Tue, Jul 07, 2026 at 02:36:41PM +1000, Seth McDonald wrote:
My goal was to _visually_ un-intertwine the current two implementations.

that could be achieved by simply factoring out two functions.

but don't do that. even if it wouldn't introduce disproportionate boilerplate to handle the return cases, it would still be churn that hinders git-blame for little benefit.

grepping the history for "factor" and "extract" (and "\<move", though that yields a lot of false positives), you'll find that most refactorings are directly followed by other changes that build on them.
but i admit that i'm a bit inconsistent about the applied criteria.

it's certainly tempting to extract the authentication logic, as that's 500 lines of seemingly well-isolated code. you can give it another shot, but this time don't try to solve several problems at once, and in particular don't pretend that you're creating two separate implementations. ifdefs are _fine_. don't over-abstract. if you extract structures from imap_server_conf/imap_store_conf/imap_store, then embed them back into their respective "parent" structures, rather than treating them as opaque handles. but it might be most pragmatic to actually just move these to imap_p.h; the overall usefulness of that would become more obvious if you tried to split off more parts. when you end up with "micro-calls" in the high-level code, then the abstraction is wrong.

speaking of splitting off more parts, see wip/server-refactor. i tentatively gave up on that one, because the protocol is just extremely messy - the untagged responses that actually belong to specific commands make a clean callback structure kinda hard.


_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to