On Sat, Apr 3, 2021, 12:34 AM Greg Ewing

> In my experience, RPN is always harder to read than infix. A slew of
> parens can be confusing, but a bunch of operators piled up at the end of an
> expression doesn't make it any better for me.
>

When I first saw the original post, I honestly believed it had to be an
April Fool gag.

Like Greg, and 99% of other people, I find RPN vastly harder to parse. I
have also written or edited Postscript by hand, but much more small
hobbyist level than a real work need. It's crazy difficult.

 I confusedly accept or stipulate that John is in that <1% who process this
differently.

But the greater difficulty of RPN isn't only my greater familiarity with
infix, it's also objectively measurable. The example John gives makes infix
capriciously worse by omitting normal spacing (while keeping them by
requirement for postfix). But let's bracket that.

A reasonable measure of difficulty is simply to count the number of eye
movements required to parse each version. In John's example, or any of
similar moderate complexity, postfix requires 1.5-2x as many eye movements
as infix. You can measure this in a manner similar to Levenshtein distance,
as a collection of small atomic actions.

It's not so much that moving eyeballs is difficult for most people. Rather,
every such movement is a very slight mental pause to redirect attention.

Of course, you never need to do anything other than scan left to right if
ALL you are trying to understand is the final result. But that's not what
we do when reading computer code. Rather, we want to understand the WHY and
the WHAT of an expression as a whole.

>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/FZPABRYJIRXQOTQTINI4GILUWWV7UCGN/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to