3 ms·
I think you should copy/paste the whole function, change one of the copies to suit your needs, and then factor out any subroutines the functions have in common.
by erikpukinskis 8y ago
I think you should copy/paste the whole function, change one of the copies to suit your needs, and then factor out any subroutines the functions have in common.
This is what OP recommends too.
- logicallee 8y agoThat works okay for the first bool, but for the second duplication wouldn't there be 4 versions already?
- erikpukinskis 8y agoYou can have 1000 versions. As long as the function is mostly free of side effects, except whatever side effects are documented in a public interface, then you can scale the repository linearly without any real increase in complexity. This is because while the namespace is wide, in practice you work within a “working set” of your daily use packages.