Skip to content
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

Contradictory suggestions are confusing. #3

Open
RudolfMan opened this issue Mar 21, 2024 · 2 comments
Open

Contradictory suggestions are confusing. #3

RudolfMan opened this issue Mar 21, 2024 · 2 comments

Comments

@RudolfMan
Copy link

I see that

This catalog of refactorings aims to improve the quality of code developed in Elixir, helping developers promote the redesign of their code, making it simpler to understand, modify, or even improving performance.

At the same time Introduce import explicitly calls out that it's a reverse of Remove import which is confusing.

Overall I feel the sentiment in the community is established to prefer aliases over imports for the reasons described in the remove import refactoring.

@lucasvegi
Copy link
Owner

Hi @RudolfMan ,

Here we revisit some points that I mentioned in the response to the other issue. A catalog of refactorings doesn't dictate rules about what is right or wrong; everything depends on the application context, which should be evaluated by the developers themselves. A catalog is like a toolbox: the choice of which tool to use is up to the user.

The example you found contradictory, of one refactoring being the inverse of another (Introduce import and Remove import attributes), is common in catalogs of refactorings, including Fowler's. For instance, Inline Method and Extract Method, which are two of the most traditional refactorings, are inverse of each other. In the catalog of refactoring we are proposing, this happens among many others as well.

@lucasvegi
Copy link
Owner

Overall I feel the sentiment in the community is established to prefer aliases over imports for the reasons described in the remove import refactoring.

All refactorings in the catalog were extracted from distinct sources, such as scientific articles, the 10 most popular Elixir repositories on GitHub, and publications from grey literature (often created by members of the Elixir community). At no point did we 'invent' a refactoring. As we conduct the survey, evaluations like the relevance of each refactoring will greatly help us quantify community perceptions. Therefore, it may be that within a few weeks, this feeling of yours will be confirmed (or not). 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants