Somewhat off-topic: the author repeatedly suggests that prefix notation isn't as pleasant to read as infix because natural language uses a Subject-Verb-Object ordering. Most human languages actually use a Subject-Object-Verb ordering (e.g. Japanese, Turkish, Hindi, &c), but I've never heard of anyone from any of these other cultures implementing an SOV programming language[1]. Does anyone know whether this kind of reasoning (i.e. "This is more intelligible to me because my natural language does it as well") has ever been actually researched? (Unfortunately, when it comes to things like language, someone's gut feeling can be deeply and remarkably wrong.)
[1]: As far as I can recall, this and Perl's Lingua::tlhInganHol::yIghun are the only languages I've seen that really have postfix functions. I could be wrong.
Stack languages like Forth and PostScript could reasonably be considered SOV. In PostScript, even control flow words come at the end, with subordinate clauses being deferred by curly braces: « (Hello, world!) 2 2 add 5 eq { 0 5 getinterval } { 7 6 getinterval } ifelse » places the string "world!" on the stack.
> Does anyone know whether this kind of reasoning (i.e. "This is more intelligible to me because my natural language does it as well") has ever been actually researched?
Researched? Not that I know of. But I know that Larry Wall tried to do this with Perl (i.e. the @array vs. $array[item] distinction as a parallel to the use of plurals in natural language). I'm not sure it really worked out well. Part of it could be due to bad interactions with all the punctuation and Huffman coding, but I think another reason is that programmers expect a more regular and mathematical notation from a programming language, rather than a linguistic notation.
> As far as I can recall, this and Perl's Lingua::tlhInganHol::yIghun are the only languages I've seen that really have postfix functions. I could be wrong.
PostScript has postfix functions, due to its nature as a stack-oriented language.
I've always held that if you name your methods and variables right, many lines of code can be read as sentences.
When describing the fetchmail config syntax, ESR commented that you should be weary of making something too much like natural language and too complex, but that he added certain optional tokens that get filtered out to make the syntax more readable.
Like the `wtf' command (from BSD?). It tells you what something means. The syntax is "wtf [is] <acronym>". To a unixhead, the is isn't necessary, but it makes the command read like a sentence.
If I'm willing to add in those little words, I find the best lines of code will read like a sentence
I do that sometimes with java code. My support guys have given me some "thanks, your code is easy to read" type emails occasionally. Good naming helps, although some consider it overly verbose. To wit:
public static final BigDecimal BY_100 = new BigDecimal("100.00");
...
BigDecimal amountInDollars = amountInCents.divide(BY_100);
[1]: As far as I can recall, this and Perl's Lingua::tlhInganHol::yIghun are the only languages I've seen that really have postfix functions. I could be wrong.