4 ms·
I kinda agree. But my personal take is different. Functions can be invoked in at least 3 different ways or a mixture of the three 1. Prefix - C style f(x,y,z)
by random314 4y ago
I kinda agree. But my personal take is different.
Functions can be invoked in at least 3 different ways or a mixture of the three
1. Prefix - C style f(x,y,z)
2. Infix - x + y; x.f(y,z); a join b
3. Post fix- (x,y,z) $ f
Infix is the best style in most cases, OOP accidentally helped programmers use a more readable infix style.
A lot of the benefits of OOP can be had by allowing good infix invocation support and interface support in an imperative non OOP language. Might as well throw in generics.
- pphysch 4y agoYes, you put it better. Infix is tricky because it doesn't scale well to complex expressions. I think Python does it right with plenty of infix keywords a la "if thing not in myset: ...".