Thursday 5 March 2020

On Polish Notation in Software Design

I was looking up Polish Notation, as I remember hearing about it.

And it turns out Polish Notation is actually, basically, when you think about it, exactly how programming languages in my experience work.

For example:

x − 5 6 7

Is polish notation for:

(5 - 6) x 7

This is very very difficult to understand for someone like me who is absolutely not used to Polish Notation.

However, when I write this down in programming language method calls, everything becomes crystal clear immediately.

multiply(minus(5, 6), 7);

For some reason, the statement above makes perfect sense to me.

Likewise as in the Polish Notation, in software design method-calls, the sequence of statements is unambiguous.

With the infix notation, parentheses are required to override operator precedence rules.

Both in Polish Notation as in programming, this does not seem to be required.

References

Wikipedia - Polish notation
https://en.wikipedia.org/wiki/Polish_notation