This may not be strictly naming related, but when ...
# naming
l
This may not be strictly naming related, but when you read the :: syntax in kotlin (such as checking ::myVar.isInitialized or passing a method reference to a function), how do y’all pronounce it in your head?
I feel like
Paamayim Nekudotayim
is a bit too long and a bit too PHP.
s
I add "ref" to the name in my head.
::someVariable
sounds in my head like "someVariable ref"
l
Does that extrapolate to methods, especially like
map(someObject::someMethod)
or even
map(something.somethingElse::someMethod)
?
s
Then i may add "ref to" to the beginning (instead of " ref" to the end) "ref to someObject someMethod"
l
I’ll have to start using that.
l
I usually don't pronounce it in my head, but sometimes, I think of it as "4 dots" or "double colon"
d
I think this called a
cons
operator. Scala and Haskell calls it that; I am pretty sure F# also calls it that too.
That ☝️ is a bit Lisp specific but it’s used like this in many functional languages.
e
cons is a very different operator, though
I usually think of it as "bind", e.g.
::myVar
is
this::myVar
is "`myVar` as bound to `this`". kinda breaks down at the top-level though