The Apropos show with Zach Tellman was a success (despite a technical hiccup; it wouldn’t really be Apropos without hiccups). And this week we have Alex Miller as a guest. Will Alex explain monads or transducers? Please join us on YouTube. You can ask us questions in the chat.
Have you seen Grokking Simplicity, my book for beginners to functional programming? Please check it out or recommend it to a friend. You can also get it from Manning.
Expressivity: A fourth definition
I like words. I’m a writer. I find that I use words without really knowing what I mean by them. And the more I clarify my own usage of the word, the clearer my ideas become when expressed in writing.
And see, I used the word there: express. It’s a tricky word. It comes ultimately from Latin, meaning “to squeeze out”. I think the etymology is useful only for its poetic value. When we talk about expressing emotion, we’re not squeezing anything literally.
Express is an active verb that we’ve nominalized as “expression” and adjectivized as “expressive”, then we nominalized the adjective as “expressivity”. So it’s already two indirections removed from the more direct version. No wonder it’s tricky to talk about.
I tried to explore the different meanings of expressivity as we use it to talk about programming languages. I came up with three. So you don’t have to read that other essay, here are the three meanings:
Expressivity is equivalent across all Turing complete languages (boring!).
Type systems limit expressivity by disallowing you to express type unsafe code. Another point of view (with the same meaning of the word) is that typed languages are more expressive because they allow you to talk about the types.
Expressivity is the subjective ease of solving a particular problem in the language.
They’re not bad (if you’re clear on which one you’re using). But there’s one use of the word that I only recently came up with while I was reorganizing the material for the book I’m working on. When we say “a poem is very expressive”, we aren’t talking about the writing process. It’s about the reading experience! It means it is good at evoking emotions or imagery or something in the reader. The three definitions above are all about what you can say (or how easy it is to say it). They’re not about reading at all.
Now, to be fair, using expressive to talk about the reading experience is not doing justice to the active nature of the verb. The author of the poem is expressing something through the words. But the usage is clearly about the decoding end of the communication. And I think we should apply it to code.
It’s ironic that we talk about code readability all the time, but I don’t think we use the term expressive in that context. But maybe we should. It’s probably better than readability. Because with readability, you get into all sorts of stylistic concerns. Is a for loop more readable than recursion. Is double negation less readable than a positive? However, expressivity implies that the code makes it easy for the reader to understand something else. And that something is the domain model. I hereby declare that expressive code means it is easy to recover the domain model (or design) from the code.
So there’s a fourth definition of expressivity, more focused on the reading experience than on the writing. I really love words. They’re so rich and complex. What words do you think we abuse in programming? I’d love to hear it.
> What words do you think we abuse in programming?
"Technical"
It's abused in the programming community in the sense that it's used as a work dividing line. For example, if a programmer starts talking about the details of program, and all of a sudden, those "technical details" that many members aren't concerned with.
The reality is, though everything, from the quarterly earnings, to your client's names, are all "technical details," and the issue isn't that one is perceived as programming or the other marketing, it's that everyone in the business universally struggles to communicate what benefit their areas of responsibility cover.
I'm picking on technical specifically because programmers take pride in being perceived as such, and that pride often blinds us to what's really happening, which is that we're avoiding difficult conversations.