| > which makes it easy for a machine to parse, but harder for a human. That is a naive fallacy. What is harder for the machine is harder for the human. By and large, humans rely on formatting cues, especially indentation, to parse programs. Human eyes can be fooled fooled by bad indentation: /* C */
if (foo)
bar();
cleanup();
if (outer)
if (inner)
foo();
else
bar();
If you want to compare human versus machine parsing, then you need to write all the code samples on a single line with no breaks (if the programming language allows that). All optional whitespaces that can be written as a single space should so be written. This way, the humans are actually parsing the same tokens as the machine and not relying on cues that aren't part of the language.> I personally prefer syntax to be designed for humans to read and write There is no such thing in existence. People who design syntax simply use their whims, rather than any cognitive science that brings in any measure of objectivity. Those whims are shaped by what those people have used before. The concept behind Python is actually the closest to getting it right: it recognizes that people really grok indentation rather than phrase structure, and so it codifies that indentation as the phrase structure. > Languages are a minority in terms of usage indicating that my preference might not be common That's another fallacy. The vast majority of all programming and other computing languages that have ever been invented are not used at all, or used by a vast minority. In that vast majority, we can find the full gamut of what has been done with syntax, semantics and everything else. Popularity and lack thereof isn't trivially driven by cosmetics. |
No, I'm not claiming an essential difference, merly that they are optimized for different things.
>There is no such thing in existence.
Of course there is, machine code is designed for computers, higher level languges are designed for humans.
>Popularity and lack thereof isn't trivially driven by cosmetics.
I'm not talking about what drives popularity, but what drives cosmetics.