<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
You give data to show how little this new widget would be used in a
fairly large codebase.<br>
<br>
You imply that this new thing would improve "readability and
maintainability". Do you have any data to back up that claim?<br>
<br>
This addition would be used so little, it has questionable benefits,
the response to it has been almost unanimously against, ... surely
the erlang maintainers have better things to do with their time.<br>
<br>
This new bug would damage the language and pushing it through would
damage the community.<br>
<br>
Ivan<br>
<br>
<br>
<div class="moz-cite-prefix">On 15/01/2021 12:34, Richard Carlsson
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CANKG3z=8641SxUstWEeDCwFMoYWq5tmvYxW85dpdyrp8N_99tg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>There have been many strong reactions in this thread, so
let me give you some statistics to show how much this feature
of using bound variables is actually used in practice. I
checked the entire OTP codebase: there are just over 1300
modules, and in total about 595000 variable occurrences in
patterns, of which only 3350 are already bound.. That makes
0.56% of all variables in patterns - about once in 200 to make
it simple. On average, that's 2-3 usages per module - some
modules using it more and some not using it at all.</div>
<div><br>
</div>
<div>I find it hard to see, then, why it should be a big issue
to ask programmers to annotate these few occurrences for
readability and maintainability. It's certainly not as big of
a change as for example when the warning for unused variables,
unless prefixed with _, was made the default.</div>
<div><br>
</div>
<div>Imagine a world where Erlang had not allowed already-bound
variables in patterns (forcing you to use the idiom "X1 when
X1 =:= X -> ...", as in e.g. Haskell), and that someone now
came with the suggestion that to make things simpler, we could
just implicitly match on the value of X if X is already bound.
The old me from my university days would probably have said
"that's really elegant, let's do it". But the
maintainability-and-readability me, with experience of very
large code bases, large numbers of developers, and many
relative newcomers to the language, would say "aw hell no".
This is a cute feature, but it carries a large cognitive cost
and is not worth having compared to how relatively little it
is used. Being explicit about intention is much more
important.</div>
<div><br>
</div>
<div>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature"> /Richard</div>
</div>
<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Den tors 24 dec. 2020 kl 21:10
skrev Richard Carlsson <<a
href="mailto:carlsson.richard@gmail.com"
moz-do-not-send="true">carlsson.richard@gmail.com</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">The ^ operator allows you to annotate
already-bound pattern variables as ^X, like in Elixir. This
is less error prone when code is being refactored and moved
around so that variables previously new in a pattern may
become bound, or vice versa, and makes it easier for the
reader to see the intent of the code.
<div><br>
</div>
<div>See also <a
href="https://github.com/erlang/otp/pull/2951"
target="_blank" moz-do-not-send="true">https://github.com/erlang/otp/pull/2951</a><br
clear="all">
<div>
<div dir="ltr"><br>
</div>
<div>Ho ho ho,</div>
<div dir="ltr"><br>
/Richard & the good folks at WhatsApp</div>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
============================================================
Ivan A. Uemlianin PhD
Llaisdy
Ymchwil a Datblygu Technoleg Lleferydd
Speech Technology Research and Development
<a class="moz-txt-link-abbreviated" href="mailto:ivan@llaisdy.com">ivan@llaisdy.com</a>
@llaisdy
llaisdy.wordpress.com
github.com/llaisdy
<a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/ivanuemlianin">www.linkedin.com/in/ivanuemlianin</a>
festina lente
============================================================</pre>
</body>
</html>