Survey on Refactorings for Elixir

Hello everyone, how are you?

I believe many of you may know me from the research I conducted on code smells/anti-patterns for Elixir, which was partially incorporated into the official Elixir documentation.

Currently, my Ph.D. advisor and I are investigating refactoring strategies for Elixir and cataloging them. For this reason, we need your help to identify which refactorings are most frequently performed in your Elixir systems and which ones bring positive impacts on maintainability, comprehensibility, and evolution of your Elixir code.

If you are interested in the quality of your code, could you please help us by answering this survey on refactorings? (it should take 20 minutes)(https://lucasvegi.github.io/Elixir-Refactorings/)

Thank you!

banner-tweet

Note: The complete catalog consists of 82 different refactoring strategies. However, each participant will be asked to respond to only a small portion of it, randomly selected. If you are interested in exploring all the refactorings, access the complete catalog.

29 Likes

Thanks, @josevalim! I really do appreciate you having pinned the post!

4 Likes

Done.

Btw. re [Struct field access elimination] see:

4 Likes

I’m confused about the meaning of the ‘relevance’ metric in the survey. For example, consider this question:

[ Transform a body-recursive function to a tail-recursive**]**.
This refactoring aims to convert a body-recursive function into a tail-recursive one, thus improving runtime performance due to the tail-call optimization provided by BEAM. More details and code examples here: [LINK]

I believe that the relevance of this very much depends on the particular function (does making it tail-recursive decrease readability and how much?) and, most importantly, on the expected input (do we expect infinite recursion and having a memory leak, or do we expect at most 10 stack frames to be kept at any time?). What should be my answer to this?

2 Likes

Hello, I understand your question. In fact, the relevance of a refactoring may depend on the application scenario, as you said.

I recommend that answers are always based on the worst case that the developer has experienced or is aware of someone having experienced. In this specific refactoring, as you said, it could be an infinite recursion, memory leak, etc.

In short, think something like this: “In general, can this bring me more advantages or not?”… The more advantage, the closer to 5.

4 Likes

For those who haven’t answered our survey yet, professor @adolfont made a short video showing our survey inside and how easy it is to answer it!

2 Likes

10 posts were split to a new topic: Split posts from refactorings survey thread

I would like to thank the great number of devs who have already participated in our survey. For those who have NOT yet participated and are interested, we will collect responses until April 3rd at 11:59 PM (UTC-3).