3 ms·
>Most of the IDEs I've worked with in the past 15 years warn me of overshadowing Most IDEs adapt their rules for warnings to the file type. As i understand it
by nuancebydefault 2y ago
>Most of the IDEs I've worked with in the past 15 years warn me of overshadowing
Most IDEs adapt their rules for warnings to the file type.
As i understand it, Elixir leans more to the functional paradigm, so the rules are different. This different paradigm has the pros described in the article. Of course it also has cons.
If shadowing is a feature of the language, a feature that is often used, the programmer, who has shifted their thinking to that paradigm, knows that, and a warning is not needed.
- cies 2y agoI'd say that rebinding a value to a variable is similar to shadowing IN THE SAME SCOPE. Pretty much what Haskell does with the do-notation.
- cies 2y agoI find FP and shadowing have nothing to do with eachother (maybe except though Haskell's do-notation)
- nuancebydefault 2y agoYou have a point. Maybe the shadowing is a paradigm on itself, supporting FP. If you know it happens all the time, and you know every var lives in the current scope, all you have to care about is the current scope. Just like in C function-local-vars (which might or not shadow globals) , but then applied to every code block.
- mrkeen 2y ago> Maybe the shadowing is a paradigm on itself, supporting FP. Not really. Shadowing is compiler-warning in Haskell.