exercism / exercism/elixir-representer

What should and should not be normalized?

オープン
#38 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Elixir
スター
11
フォーク
8
平均マージ
11日 3時間
マージ済み PR(30日)
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。