<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 17.09.2015 23:56, Ryan Gonzalez wrote:<br>
<blockquote
cite="mid:CAO41-mPuBr7tgkft_g26XD12xTjtUCPsS_ZLLb3yNXJxDbKVNQ@mail.gmail.com"
type="cite">
<div dir="ltr">Embedding type names in arguments and method names.
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Sep 17, 2015 at 4:45 PM, Sven
R. Kunze <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:srkunze@mail.de" target="_blank">srkunze@mail.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
class="">On 17.09.2015 23:19, Ryan Gonzalez wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px
0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">def
process_integer_coordinate_tuples(integer_tuple_1,
integer_tuple_2, is_fast): ...<br>
<br>
vs<br>
<br>
def process_coords(t1: Tuple[int, int], t2: Tuple[int,
int], fast: bool): ...<br>
<br>
Java's fatal mistake.<br>
</blockquote>
<br>
</span>
Care to elaborate?<br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
I was actually confused by 'Java' in your reply.<br>
<br>
<blockquote
cite="mid:CAO41-mPuBr7tgkft_g26XD12xTjtUCPsS_ZLLb3yNXJxDbKVNQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">You said:</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">>Â Even good variable names can leave
the type ambiguous.</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">These are names that don't leave
anything ambiguous! :D</div>
<div class="gmail_extra">
<div><br>
</div>
</div>
</div>
</blockquote>
<br>
They just do. Because they don't tell me why I would want to call
that function and with what.<br>
<br>
If any of these versions is supposed to represent good style, you
still need to learn a lot.<br>
<br>
<blockquote
cite="mid:CAO41-mPuBr7tgkft_g26XD12xTjtUCPsS_ZLLb3yNXJxDbKVNQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div>Really, though: relying on naming to make types explicit
fails badly whenever you start refactoring and makes hell
for the users of the API you made.</div>
</div>
</div>
</blockquote>
<br>
Professional refactoring would not change venerable APIs. It would
provide another version of it and slowly deprecate the old one.<br>
<br>
Not sure where you heading here but do you say t1 and t2 are good
names? Not sure how big the applications you work with are but those
I know of are very large. So, I am glad when 2000 lines and 10 files
later a variable somehow tells me something about it. And no "<span
class=""><b>Tuple[int, int]</b>" doesn't tell me anything (even
when an IDE could tell that).<br>
<br>
Most of the time when discussing typecheckers and so forth, I get
the feeling people think most applications are using data
structures like <b>tuples of tuples of tuples of ints</b>. That
is definitely not the case (anymore). Most of the time the data
types are instances, list of </span><span class=""><span class="">instances</span>
and dicts of </span><span class="">instances</span><span class="">.<br>
<br>
That's one reason I somehow like Jukka's structural proposal
because I actually can see some real-world benefit which goes
beyond the tuples of tuples and that is: <b>inferring proper names</b>.<br>
<br>
Best,<br>
Sven<br>
</span>
</body>
</html>