(My comment below generated a bit of interest in a...
# thinking-together
s
(My comment below generated a bit of interest in another forum so I want to copy it here as a prompt.) What do folks think about the emphasis on "readability" for programming languages?
Readability in PLs is nice, but ultimately a red herring. It doesn't scale. We may be able to read a small snippet and get it, but once we have more code or more abstractions, we're lost again. The real goal should be to offload all mechanical computation to the machine.
IOW, readability gives a very small step. It may be easier to build a "structure in your head" after reading a "more readable" representation (vs a less readable representation of the same thing). However the work really starts after you have this structure, when we begin "playing computer" in our heads.
8
k
a
Oh, it's a local vs global argument? Interesting. The point being that locally readable code is not the bottle neck, but globally "readable" (comprehensible?) code is.
👍 1
n
Locally-readable code is definitely a bottleneck. I dare you to try and tell my students otherwise after they’ve spent 12 weeks trying to learn Python fundamentals :/ But anyone defining “readability” as merely naming plus commenting is missing the obvious: the actual language that those names and comments are embedded within! The grammar and semantics of a language matters at least as much as the names that are used within it.
But yes, large-scale understanding is a separate issue requiring its own solutions.
t
global readability is a by product of global consensus. It is harder now days to achieve global consensus, because the skill and platform driving teams to be more and more narrowly focused. When everybody has ideas of how to organize, global readability is hard to achieve.
w
Code is pretty low level: it's hard to get an overview of it. Low level consistency, in naming for instance, will give you insight into what's going on, and I think more importantly, those who write locally readable code are also more likely have a good architecture.
c
I would say observability is equally important. It's nice and all if the code is readable, but many times the code goes slightly out of date with it's names. And, the way it works makes a lot more sense when you have good tools for inspection into what's going on or what happened.
👍 2
s
I believe local vs global is Kartik's argument. I do agree. I think my original argument isn't exactly that but it overlaps. Say you're a circuit designer and see two circuit diagrams for the same circuit. One diagram has squiggly lines, symbols are not clearly represented, multiple symbols are used for the same type of device. Another has a neat layout, parallel lines, few crisscrossing lines, crisp consistent symbols etc. The latter is more "readable". This is good yes. But it thinks of the medium as static paper. If you have a bajillion devices and lines, this level of readability doesn't buy you much. So the focus on readability is a bit off the mark, specially when talking about large scale systems. What can help is if the system can tell you the high level system design first (I think what Kartik is suggesting) or if you can query the system and determine connections (e.g. does component A output lead into component B) and can make the system simulate itself (these are the things I'm talking about)
k
Very interesting. Does seem like a complementary frame. My first reaction, while I'm still attached to my perspective: it's hard to determine what questions to ask in a complex system without first having a good hierarchical decomposition in your mind. The lesson of http://worrydream.com/MagicInk is that while interaction is important (see everything by Bret Victor after it) it's more important to start from a baseline visualization that requires as little interaction as possible.
s
Yes, they are complimentary. I agree with readable-bad.
The thing I was emphasizing was that when scaling up, readability is fairly low in what will help but things like "queryability" and "explainability" help a lot more. A simple example is jump-to-definition style links, which is a query and gets much more valuable as the code size grows. However I think a lot more queryability is possible but it is not something language designers usually consider, compared to, say how "readable" the syntax is. I'd like to see more discussions asking the following during language design/discussion: what kinds of information would the developers want to extract from largeish code bases and how can we make this language/system that answers them effectively.
☝️ 1
k
Ah, I see. Yes, we're both asking the same question 👍🏼