exercism / exercism/elixir-representer
What should and should not be normalized?
- 主要语言
- Elixir
- 星标
- 11
- 派生
- 8
- 平均合并
- 11 天 3 小时
- 30 天内合并 PR
- 1
描述
I thought it would be a nice idea to discuss ideas on things that should and should not be normalized. I sometimes have ideas and then I convince myself that it should not be done, or I open an issue and close it a bit later (ahem #36), so it might be good to have a trace of ideas.
Here are a couple ideas that I had. Mostly bad ones, but I want to explain why.
### All function arguments should receive a new placeholder 🚫
This is #36, but it is specifically mentioned in the documentation of something not to do. I thought that two people with the same solution that only differ with a variable name should represent the same way, but it's not true. If one of the solution has a variable name that is shadowing another, it could be confusing or bad practice, so it should be pointed out when it is.
### Anonymous functions should be represented the same way 🚫
The functions `&length/1`, `&length(&1)` and `fn x -> length(x) end` all do the same thing, so they could be represented the same way. However, the readability is quite different, so we might want to point out better options depending on context.
### Normalize functions order 🚫
The docs mention "[Normalize the order where insignificant](https://exercism.org/docs/building/tooling/representers/normalization)" so I thought we could reorder functions, but even the compiler has opinions on how functions with the same name and arity should be grouped together, so we shouldn't touch it.
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。