What does “less readable” mean for you? Without understanding your personal sense of readability, it is difficult to know how to interpret your claims about readability.
On its own, “less readable” carries about as much information as “I don’t like it”. What makes it less readable?
-
Is it too verbose?
-
Too terse?
-
Too ambiguous? E.g. Python uses the
*
symbol for nearly a dozen different things, if we include the stdlib as well as the syntax itself. -
Full of weird symbols that have to be memorised by rote?
-
Are the symbols visually hard to distinguish, e.g. in many fonts $ and S look very similar.
-
How does it compare to other syntax in Python?
Regarding the last point, is x + y
less readable than add(x, y)
? How about x**y
compared to pow(x, y)
?
If you answered “Yes”, then maybe you just don’t like symbolic operators, and prefer words, so of course you will dislike the ??
symbolic operator.
But if you find the +
and **
operators more readable than the named function calls, and yet find the ??
operator less readable, that possibly means you are confusing familiarity with readability. You find +
and **
readable because you are used to them, while ??
is unfamiliar.
Never underestimate the difference familiarity makes to readability. The first time I tried to read Python code, I found it an unreadable mess. It was full of weird symbols like [:]
and {x: y}
and I had no idea what was going on. Now I find Python so readable that every time I try to read code in another language, I cry
My personal feelings are:
-
I think that dealing with None is a minor pain point. It would be nice to have a better (easier, more terse) way to deal with it.
-
I like the look of the
??
operator. It feels right to me, it’s not too weird, and is easier to remember. -
I expect that as other languages introduce the same operator, it will get more familiar and more people will come to expect it.
-
I’m neutral towards the
?.
and?[]
symbols. They don’t look as nice, but I can’t think of a better alternative. -
I don’t think it is worth implementing just the
??
and not the other two.
So I guess that overall I’m positive towards the PEP.