by guerrilla · 7y ago · 0 comments
Furthermore, a bunch of things being named terribly doesn't support the thesis that names don't transmit meaning. It supports the thesis that a bunch of people failed to communicate and they should have put much more effort into naming things accurately.
> Names don’t make them any easier or harder to understand
If we renamed every variable in Firefox, for example, with numbers, people would find it more difficult to understand, so this is an absurd thing to say. The reason we use names is because they do convey meaning. That meaning (index into our conceptual map) is what differentiates them from the numerical value of the string of letters which make up their textual representations and makes them so much easier to remember and understand contextually!
---
Whenever the topic of names comes up, I reread one of my favorite blog posts I've ever come across: "What's in a Name" by Olin Shivers [0]. Here's the thesis statement:
> [My thesis advisor, Allen] Newell [...] explained his understanding of names: “They provide distal access.” That is, a name is a local piece of data that stands for some other piece of data, which is presumably large and remote. You can now use that small, convenient, local datum instead of the large, remote thing for which it stands.
(If, like me prior to reading this, you're unfamiliar with the word "distal", it means "Remote from the point of attachment or origin." [1])
Thank you for this! It was a really engrossing read.
> When he said “distal access,” he assumed that you, too, have structures on one side of your head representing what you know about, say, Neil Armstrong, and a smaller structure on the other side of your brain encoding the name “Neil Armstrong,” and cognitive mechanisms allowing you to fetch the former given the latter.
I thought this was an interesting example that glossed over some (to me) really interesting things in cross-contextual (usually cultural?) miscommunication. This assumption that the other person you're talking to has the same concept in mind for a word is at the root of all communication we do.
A simple example would just be UK to US English -- something as simple as "fanny," which has differing meanings to both populations.
For a non-geographical contextual gap, we can look at slang like "salty." a "salty meal," "salty boy," and "salty dog" are all completely different things.
Some of the biggest difficulties I run into with communication aren't with people who speak no English at all (I live in Japan), but people who speak English in a dialect(?) that's close to what I expect, but slightly different and used differently (e.g. as high context instead of low context). Sometimes I can be speaking with someone from India who has perfectly grammatically correct, fluent English, and suddenly be thrown for a loop when I realize that a word had a completely different meaning for both of us without either of us realizing it.
It's just a really interesting concept I think about a lot since I do a lot of cross-cultural communication.
`Mappable` provides short-term comfort due to familiarity, but to do so it sacrifices precision that is essential in the long term.
1) For all sets s, s.map(identity) == s ==> true
2) For all sets s, functions f and g, s.map(x => f(g(x)) == s.map(g).map(f) ==> true
On the other hand, Map's map method is much more horrible, and does violate the 2nd functor law where f == g == _.swap :
Map(1 -> 2, 2 -> 2).map(_.swap).map(_.swap) ==> Map(2 -> 2)
Map(1 -> 2, 2 -> 2).map(_.swap.swap) ==> Map(1 -> 2, 2 -> 2)
Further, it behaves differently depending on if it is known to be a Map at compile-time, or if it is only known to be an Iterable[(K, V)], due to overloading:
Map(1 -> 2, 2 -> 2).map(_.swap) ==> Map(2 -> 2)
(Map(1 -> 2, 2 -> 2): Iterable[(Int, Int)]).map(_.swap) ==> List(2 -> 1, 2 -> 2)
Definitions are precise, not names. Names aren't what makes math work, it's the precise definitions, inference rules and theorems, regardless of the language in which they are written. 'printf' does not work the same in all programming language yet everyone knows what that name means.
If you were to take someone who is new to programming and talk about mappable datastructures they would look at you blankly, but any random JavaScript programmer should know what you mean instantly.
I can forgive Haskell for using the word "functor" because it came from academic roots, it isn't a language like Go designed specifically to make things easy for programmers to pick up.
Why isn't Set a Functor? Because it doesn't obey the functor laws (because a == b doesn't imply f a == f b). Why are those the functor laws? Because that's all that Functor means.
Why isn't Set a Mappable? Because it doesn't obey the Mappable laws. Why are those the Mappable laws? Because they're the Functor laws? Why should that be the case? Maybe we should pick (or have picked) different laws for Mappable? Maybe we'll find better laws for Mappable, but we've given up that rarefied connotative linguistic real estate. There's extra room for drama and bike-shedding that isn't present when we're using already established names that precisely describe the interface even if they happen to be unfamiliar.
Similarly, if Semigroup should be called Appendable, what would you call Monoid? And is there a consensus on Monad as well?
On the other hand, obviously Monad should be called Burrito.