-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Walk
seems to be not elegant
#3755
Comments
@yegor256 @maxonfjvipon WDYT? |
@ArtemGet you may find this article relevant: https://www.yegor256.com/2015/10/01/vertical-horizontal-decorating.html Your reasoning is valid, but such a refactoring will only make our code more verbose (more lines of code) while giving no practical value -- the |
@ArtemGet Interesting suggestion, actually. The only problem I see now is the absence of a reason for the change. Your design potentially might simplify the code I understand, but it's hard to imagine if it will help or just add a few more lines of code. I suggest implementing #3708 first. Then, if you are right, we will see the places where this refactoring is needed. |
@volodya-lombrozo Thanks, will do Phi/Unphi cache first. |
Walk
class is not elegant because of prestructors that accessing unmanaged resources and implementation inheritance.I believe that:
Walk**
classes should implementIterable<Path>
instead of extendingListIterator<Path>
.iterator()
is called.including()
orexcluding()
methodsExample of api usage:
instead of:
This refactoring should be useful in PhiMojo and UnphiMojo does not use cache #3708, because there is a need to compare and exclude paths of already translated files. This logic is good to be placed in one of
Rule**
classes that could be represented as lamba function in most cases.The text was updated successfully, but these errors were encountered: