by sklogic · 10y ago · 0 comments
Not any harder than following Master Yoda speech.
OTOH, following something (say, an English text) (which is heavily parenthesised) may be (I'm sure there is a lot of references to back this notion) exceptionally hard (even if there is just one nested level (and more levels certainly add more confusion)). Choosing flat over structured often makes a lot sense.
6 8 7 5 4 + * - + .
-49 ok
Tell me that's easier to read than 8+6-(4+5)*7
Parenthesis can make things harder to understand if poorly used. RPN can make things harder to understand if poorly used.The reverse is also true for both. Forth does not prevent bad code.
Because of this effect you cannot trust your own sense of what is inherently easier to read, it will be biased by experience.
Funny you should say that, when basically every person in the world going through a basic mathematics curriculum will be experienced with infix notation, and completely unfamiliar with RPN.
True, maybe you for some reason have more experience with RPN. So use Forth.
But there is a clearly superior notation when you're talking about "which one will most people understand." HP calculators notwithstanding.
Whether you need more complicated arithmetic expressions depends entirely on what field you are working in. I would not call `8+6-(4+5)*7` complicated by any means.
Take my above asides ", convoluted," and ", typically,". Neither are necessary for understanding the sentence, but neither make the sentence exceptionally difficult to understand for a literate reader.
The method in which parentheses (and other structuring notations) are used is more akin to grouping from algebra and mathematics.
EDIT:
Original: OTOH, following something (say, an English text) (which is heavily parenthesised) may be (I'm sure there is a lot of references to back this notion) exceptionally hard (even if there is just one nested level (and more levels certainly add more confusion)). Choosing flat over structured often makes a lot sense.
But it doesn't make sense when we remove the parenthetical statements:
OTOH, following something may be exceptionally hard.
Choosing flat over structured often makes a lot [of]
sense.
(one edit for clarity). That first sentence has lost all meaning. Following what? Following a car on foot can, indeed, be exceptionally hard. But following a slug is often exceptionally easy.A more reasonable version of your sentence:
OTOH, following something--say, an English text--which
is heavily parenthesised may be, I'm sure there is a
lot of references to back this notion, exceptionally
hard (even if there is just one nested level (and more
levels certainly add more confusion)). Choosing flat
over structured often makes a lot sense.
Now the remaining asides (demarcated using the various English notations of em-dash, comma or parenthesis) can be removed without losing the general sense of your sentence.Nesting with commas is just as confusing as nesting with parenthesis. It forces your reader to operate with more than one contexts at a time, and this is exactly what pushes up the complexity level.
Even in Lisp, I realised that I always tend to build flat DSLs instead of the nested, using the non-parenthesised punctuation wherever possible. And I am not alone, take a look at the LOOP macro for example.