
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
"Bob Badour" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]Why is "union(union(a, b), c)" worse than the others? From a user's perspective I can see that one might be skeptical about its ease-of-use...however, do yo have any research saying that that one is decidedly better than the other?
"Marshall Spight" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
"Bob Badour" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
"Marshall Spight" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
I think we would be better off providing the language with enough flexibility so that the programmer can choose the most appropriate form of expression at the time. cf. Haskell.
Are you suggesting you prefer redundant languages?
Sometimes I have trouble understanding what you mean because you are so very terse.
You seem to have understood well enough.
Sure. But I have to guess what you mean sometimes, and sometimes I guess wrong. I think what I was trying to say was, forgive me if I guess wrong this time.
I'm happy giving the programmer the flexibility to pick the right syntax for the current context. YMMV.
Fair enough. What contexts favour prefix and what contexts favour infix?
I generally reserve infix notation for binary operators that are traditionally infix in math textbooks. I suspect, but have not investigated, that the operators of the relational algebra would work well in infix form.
Simplistic example with union: (use your imagination with the uppercase U :-)
A U B U C is decidedly better than union(union(a, b), c) and possibly better than union(a, b, c)
The last one is interesting, but for full generality, it would need to accept a variable number of arguments, and I'm suspicious of vararg functions.
Marshall
| <-- __Chronological__ --> | <-- __Thread__ --> |