3 ms·
> a large fraction of humanity simply lacks the mental flexibility to adapt to prefix or postfix notation. I doubt it. Firstly, there are entire prefix and pos
by kazinator 2y ago
> a large fraction of humanity simply lacks the mental flexibility to adapt to prefix or postfix notation.
I doubt it. Firstly, there are entire prefix and postfix natural languages, which have capable native speakers of all intellectual persuations. But in natural languages, sentences do not go to very deep levels of nesting before people get confused.
In programming, we have the deep nesting quite often. Nobody has the mental flexibility to adapt to it. We indent the code instead.
Nobody can read a large Lisp program (or even a small one) if it is flattened into one long line, which is then wrapped to a paragraph.
Within a single line of Lisp, there is rarely much nesting going on where the prefix notation causes a problem. The rest is indentation.
Everyone doing serious programming relies on their editor for that, which helps them spot nesting errors.
- lproven 2y ago> Firstly, there are entire prefix and postfix natural languages, which have capable native speakers of all intellectual persuations. Sure. And you are also aware that there are natural languages which are regarded as being very hard for non-native adults to learn, right? Some natural human languages are easier than others. This is axiomatic. Some programming languages are easier than others too. Excluding the ones that are designed to be, from INTERCAL to Ook!
- kazinator 2y agoI'm not aware that major features like verb order cause difficulty in language learning. It's usually gratuitous syntax like noun cases, especially when the same feature is not present in any shape in one's native language. Also writing systems that have large numbers of symbols, which have multiple interpretations. In any case all mainstream programming languages have prefix notation in the form of function calls. And also statement constructs that begin with a command word followed by argument material. Imperative sentences in English amount of prefix notation because the subject is omitted (it is implicitly "you") so we're left with verb and object.
- lproven 2y agoSure, but that is not my key point here. You're focussing on the detail while ignoring the general picture. I am not comparing Lisp to Mandarin Chinese or something. That would be silly. What I am saying is that there are a whole bunch of languages (both kinds) which presumably seem perfectly easy to those who grew up with them, but if you didn't and you come to them after learning something else that's much simpler and doesn't do the fancy stuff, then they seem really hard. Consistently, for lots of people, regardless of background. Doesn't matter how good your Arabic, Mandarin will be hard, and vice versa. https://www.geeksforgeeks.org/hardest-languages-in-the-world/ https://www.geeksforgeeks.org/hardest-languages-in-the-world... That list isn't sorted by your source language, your L1. That doesn't matter. If they come from an infix-notation imperative language then most people are going to find moving to an impurely-functional prefix-notation one is really hard. And most languages are infix-notation imperative languages.
- kazinator 2y agoSorry, how does the point that natural languages are absolutely hard or easy, regardless of one's native language, speak to the point that moving to a prefix programming language from infix is hard? There are hardly any Lisp programmers today who didn't "come from" prefix languages. All mainstream languages are heavily steeped in prefix notation. The infix stuff is just a small core, typically. Mainly it is for arithmetic. Sometimes for string manipulation or set operations on containers, perhaps I/O. Libraries are invoked with f(a, ...) prefix or perhaps obj.f(a, ...) mixed infix and prefix. Libraries have far more content larger than the infix material. Even small programs are divided into functions, invoked with prefix. Prefix is relied on for major program organization. Command languages use prefix: copy filea.txt this/dir. Statement and definition structures in mainstream languages are prefix: class foo {, goto label, return 42, procedure foo(var x : integrer), ... The idea that programmers coming to Lisp are confused by prefix does not hold water.
- lproven 2y agoThe core unifying point here is that some things are harder to learn than other things. If you find that a difficult idea, I don't know how else I can put it.