Preferences

I can't speak for Perl's general usefulness, but pronoun variables are just not terribly useful, because you can make them up on the spot. For example,

    result = input
    result = transform(result)
    result = transform2(result)
    return result
Perhaps I misunderstood the idea of pronoun variables. A related idea is the idea of `self` or `this`, in that computation is viewed from the perspective of an agent (which is ironically called an object when it is typically a grammatical subject).

Perhaps this is why we like OOP and CSP patterns so much, it meshes well with our social abilities.


> Perhaps I misunderstood the idea of pronoun variables.

Their point is the same as the one in human language. You can't make them up on the spot -- they already exist, with predetermined reference logic that we learn as part of learning a language. All you can do is mention them. This means they often reduce both the reading and comprehension load in comparison with inventing a new name and binding it to some referent.

For example, in this sentence:

> I can't speak for Perl's general usefulness, but pronoun variables are just not terribly useful, because you can make them up on the spot.

Who's "I"? And "you"? What's "them"? These are all obvious. Compare that with:

> I = the person writing this. This = the writing you are reading. You = the person reading this. I can't speak for Perl's general usefulness, but pronoun variables are just not terribly useful, because you... [You = someone writing code] can make them [Them = pronoun variables (though, as noted, you can't make them)] up on the spot.

Consider what it would take to write code displaying the first 10 numbers in the fibonacci sequence in some PL.

Here it is in Raku using pronouns:

    say .[^10] given 0, 1, *+* ... Inf # (0 1 1 2 3 5 8 13 21 34)
I grant that you have to learn this aspect of Raku to be able to read and write the above code. But it only takes a few seconds to learn that:

* `.foo` means applying `foo` to "it".

* `[^10]` means up to the 10th element. That's got nothing to do with pronouns, but whatever.

* The `*` in `*+*` is the pronoun "whatever" and, when used in combination with an unary or binary operator forms a lambda for that operation. So `*+*` reads as "whatever plus whatever" and represents a two argument lambda that adds its arguments.

* `...` is Raku's "sequence" operator, which uses the preceding function/lambda as the generator (which in turn uses the preceding N arguments per the generator's arity). Again, nothing to do with pronouns, and yet more you have to learn, but that's how PLs are.

It will no doubt look awfully weird, almost as weird as, say, Chinese (presuming you don't know Chinese). But that (it looking weird) is something completely distinct from whether it (using it) is extremely pleasant once you just accept it.

With a sufficiently open mind it (accepting using a "whatever" pronoun) can take literally a few seconds. (Thus kids tend to find this notion of "whatever" in Raku easy to grok, whereas adults sometimes struggle.)

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal