<div dir="ltr">[Michael Selik]<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">The conversation about syntactic sugar for ``functools.partial`` led to a question about whether jargon like "lambda" makes the concept of an anonymous function more difficult to learn.</blockquote><br class="gmail-Apple-interchange-newline">To clarify: The original statement by Steven D'Aprano, "<span style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">although possibly a less jargon name would be nicer..." indicated to me that he thought there might be situations where less jargon terms are preferable to jargon terms.<br></span><br>The argument I tried to make is, "yes I believe there are cases where a less jargon identifier is preferable and that I believe 'lambda' is an example of a missed opportunity to use a less jargon (maybe 'esoteric' is a better word here?), more descriptive name."<br><br><div>Subjectively, I don't like lambda expressions. I find the word 'lambda' to be an eye-sore in an otherwise very elegant language.<br><br>That being said: I believe subjective valuations are rarely devoid of subtle, underlying motivators that are at least grounded in logic if not objective. It's just hard to put your finger on it most of the time. I often try to root out those motivators for why I feel the way I do and articulate them as best I can. At the end of the day, though; I can't always provide a completely objective, logical proof for why I feel the way I do.<br><br>For instance: when the iPhone was introduced, a lot of people praised it's subjectively "slick" user interface. I believe that perception of slickness is partly because the iPhone emulated physical interfaces very well so it leveraged people's intuition about the physical world. It was delightfully intuitive.<br><br>I believe that part of my distaste for lambda is that it's an esoteric word that doesn't convey any meaning to someone who's never heard of a 'lambda expression' (which was the case for me when I first encountered it). Even after I had heard of a lambda expression, the fact that the word had little other connection to anything relevant in my brain meant that I had to mentally translate it every time I read for a couple of years.<br><br><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">[Steven Barnes]</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">While NOT wanting to start another fight I feel that I must put my<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">pedant hat on & point out that the above highlights why domain specific<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">words are used and their specificity actually highlights important<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">concepts, i.e.:</span><br style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> * Brakes are used to apply breaking, (i.e. to slow the vehicle,<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">possibly to a stop), while stoppers STOP something.</span></blockquote><br>I don't think this is comparable to calling a car's brakes, "stoppers" for several reasons.<br><br>1) What we call something usually relates to how humans communicate to other humans about that thing, not how we actually use the tool.<br><br>I'm not against the idea of jargon. It clearly serves a useful purpose for humans to communicate to other humans both concisely and with precision. When I tell someone at work that a service went down and they say, "I'll take a look at the logs", I know they're not talking about lengths of cut or fallen tree. I'm glad humans are so good at deducing context that we don't have to constantly disambiguate everything. I also understand that this practice of overloading words sometimes leads to strange results like "currying". Maybe calling it "signature reduction" would have been too unwieldy and/or caused confusion with the word "reduce" which is often used in the same context.<br><br>None of that has to do with how I interact with a car. Few brake pedals say "brake" on them. I don't have to use the word "brake" to slow down my car. Few of the interfaces in my car even have words. There's no lever that says "high beams". There's no dashboard indicator that says "high beams". I don't have to use the phrase "high beams" to turn on my high beams. At the same time, I don't need to use or know the word "ternary" to read or write a ternary expression in Python. I don't think that was a mistake or a missed opportunity to force people to look up the word "ternary".<br><br>Sometimes in highly specific contexts, we deal with nuanced concepts like the difference between a parameter and an argument. So we use jargon to distinguish between them. That's not as much of problem in a programming language. The constructs in Python have to have an exact meaning by default. <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Clearly defining and separating name-spaces is an inescapable fact of life in programming. </span>There's no chance of Python accidentally misinterpreting which "log" you're talking about. There's no potential for a <a href="https://www.youtube.com/watch?v=kTcRRaXV-fg">"who's on first" gag</a>. <br><br>2) Cars tend to actually use pretty sensible naming schemes.<br><br>A windshield shields you from the wind. A windshield wiper wipes the windshield. Windshield wiper fluid is fluid that helps the windshield wiper wipe the windshield, etc.<br>If they called windshield wiper solution "epsilon", it wouldn't cause more crashes or anything, it would just be more confusing than it needs to be.<br><br>3) It's not like calling 'brakes' 'stoppers'. It's more like calling an expression that makes a function by some random greek letter. I don't see much need for a metaphor.<br><br><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">[Steven Barnes]<br></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">* postprandial = after Lunch (not after eating any meal or after a snack).</span></blockquote><br>Not according to <a href="https://www.google.com/search?q=postprandial+definition">Google</a>, <a href="https://www.merriam-webster.com/dictionary/postprandial">Merriam-Webster</a>, <a href="https://en.oxforddictionaries.com/definition/postprandial">Oxford</a>, or <a href="https://en.wikipedia.org/wiki/Prandial">Wikipedia</a>.<br><br><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">[Steven Barnes]</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">In all of these cases there is a specificity to the word used that is<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">missing from the alternative offered that will, hopefully, be raised by<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">the use of that word. Unfortunately many people, when trying to explain<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">what the word means fail to highlight where it is different (the number<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">of times that I have heard people "explain" port and starboard as left<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">and right without mentioning the word bow or forward is countless).</span></blockquote><div><br>I understand the potential benefit of jargon as stated above, but even this isn't always true. Sometimes jargon is created that is counterintuitive and then it just sticks because changing it would be a huge hassle. In electrical engineering, current is supposed to be the "flow of positive charge", but charge conventions were established before we knew how atoms work and learned that positively charged particles don't often move in circuits. Dinosaurs are another good example. Sometimes jargon is a mistake.<br><br><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">[Steven Barnes]</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Using a slightly unfamiliar word can cause people to ask, or think<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">about, why this is different & what the difference is while also drawing<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">a parallel that can help the user/student to understand & remember the<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">concept.</span></blockquote><div><br>It depends on if it's easy to tie said word into a broader understanding. It's easy for me to remember that "agua" means "water" in Spanish because it's very similar to a words that relate to water in english like "aquifer". I have trouble remembering that "izquierda" means "left" because I don't know any word like it. I have to pause and think about it every time without fail! Similarly, I can guess that "anonymous function" means a function without a name, but it took me a while to get used to "lambda" because it was just dangling there with no other connection to its context. Even when I learned about lambda calculus it didn't help much because the "lambda" was an arbitrary choice. There wasn't any way for me to tie it into a richer context.<br><br><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">[Steven Barnes]</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Also, picking a label for something, and using it consistently, can<span> <br></span></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">vastly simplify things like manual searches (or on-line searches).</span></blockquote><br></div>Yes, Steven D'Aprano mentioned this and it's a fair point. I think it'd have to be pretty horrendous jargon to justify "<span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">create [an] association from scratch" as Steven put it. I've since gone back on my original push for "partial" over "given" because I don't think it meets that criteria. I think that "lambda" is a different case because there already existed several better alternatives in other languages and, in the case of "def", in Python itself.</span><br><br>[<span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Chris Angelico</span>]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Whether you spell it "function(arg) {...}" or "lambda arg: ...", it's<br></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">the semantics that are hardest to learn.</span></blockquote><div><br>Naming and semantics are essentially orthogonal. Sure callbacks and the like can require some painful mental gymnastics, but that's independent of choosing "function" or "lambda". When I talk about students having more trouble learning lambdas than I expect, I'm specifically talking about lambdas, as in:<br><br><font face="monospace, monospace">>>> func = lambda x: x*x</font><br><br>Even students that seemed to quickly grasp functions as first-class objects would stumble on basic lambda expressions. Not as much trouble as callbacks and other, more complex concepts, but more trouble than regular function definition.<br><br>Anyway, the question should be "Is it always best to use jargon in the implementation of Python features? If so, how do you figure? If not, when and why should it be avoided?"</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 15, 2018 at 12:21 AM, Steve Barnes <span dir="ltr"><<a href="mailto:gadgetsteve@live.co.uk" target="_blank">gadgetsteve@live.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 14/08/2018 20:42, Michael Selik wrote:<br>
> <br>
> Good comparisons can be found in other fields:<br>
> * Driving -- brakes vs stoppers<br>
> * Sailing -- starboard vs right-side<br>
> * Medicine -- postprandial vs after-meal<br>
> * Biology -- dinosaur vs direlizard<br>
> <br>
</span>While NOT wanting to start another fight I feel that I must put my <br>
pedant hat on & point out that the above highlights why domain specific <br>
words are used and their specificity actually highlights important <br>
concepts, i.e.:<br>
<br>
* Brakes are used to apply breaking, (i.e. to slow the vehicle, <br>
possibly to a stop), while stoppers STOP something.<br>
* Starboard = to the right when facing the bow (front of the vessel) <br>
not "my right", "your right" or "their right" (which depends on which <br>
way you, I & they are facing).<br>
* postprandial = after Lunch (not after eating any meal or after a snack).<br>
* A dinosaur is specifically an extinct terrible (formerly considered) <br>
lizard where as a Gila Monster is definitely a scary & dangerous (dire) <br>
lizard.<br>
<br>
In all of these cases there is a specificity to the word used that is <br>
missing from the alternative offered that will, hopefully, be raised by <br>
the use of that word. Unfortunately many people, when trying to explain <br>
what the word means fail to highlight where it is different (the number <br>
of times that I have heard people "explain" port and starboard as left <br>
and right without mentioning the word bow or forward is countless).<br>
<br>
Using a slightly unfamiliar word can cause people to ask, or think <br>
about, why this is different & what the difference is while also drawing <br>
a parallel that can help the user/student to understand & remember the <br>
concept.<br>
<br>
Also, picking a label for something, and using it consistently, can <br>
vastly simplify things like manual searches (or on-line searches).<br>
<br>
The English language has, historically, always borrowed, co-opted and <br>
sometimes perverted words from other languages to allow distinct <br>
concepts to be expressed concisely - which I personally, (admittedly as <br>
a native speaker), find rather useful.<br>
<br>
-- <br>
Steve (Gadget) Barnes<br>
Any opinions in this message are my personal opinions and do not reflect <br>
those of my employer.<br>
<br>
---<br>
This email has been checked for viruses by AVG.<br>
<a href="https://www.avg.com" rel="noreferrer" target="_blank">https://www.avg.com</a><br>
<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</blockquote></div><br></div>