

Writing things right - signa11
http://www.drmaciver.com/2009/01/writing-things-right/?

======
koningrobot
This only works well if every verb acts on only one noun. After that, the
single-dispatch dot-notation breaks down because you have to pass arguments.
There are more sensible ways to write a function call with multiple arguments.

In stack-based languages like Factor, you (very basically) write the arguments
in front of the function that operates on them. This works out neatly if
things are well-factored. Take the REPL for instance, which in Factor is
written as "[ read eval print ] loop", as opposed to "(loop (print (eval
(read))))" in Lisp.

But this isn't perfect either. A lot of things just look awkward, possibly
more so than with prefix notation. I think there should be some kind of hybrid
pre-/in-/postfix notation, where you can write the same function call in
multiple ways. You could even split up the function name, for example, "if-
then-else(condition, foo, bar)" could be written as "if (condition) then (foo)
else (bar)", and under the hood this would be the same thing. I can't think of
a better example, but I've done this kind of thing often enough with named
arguments.

Of course, all this presupposes that "reading like English" is something to
strive for. I think it is, though most efforts have been misguided (Cobol,
Visual Basic, replacing punctuation with English keywords).

(By the way, I think the single-dispatch dot-notation that you celebrate as
one of OO's foremost innovations to programming, is really broken. I seriously
consider it writing things the _wrong_ way :-)

