User loginNavigation |
The Value Of Syntax?There seems to be a recurring idea that languages of minimal syntax are difficult for humans to read. Stallman's quote about Lisp looking like oatmeal with fingernail clippings mixed in is an example. (Edit: Hey! You can edit these things! Who knew?!) As several people have pointed out below, it was not Stallman who said that; rather, it was Larry Wall. I find this amusing, because Perl looks like line noise to me; And yes, I am old enough to remember what line noise looks like. (end edit) And, actually, I can understand it. In lisp dialects with no reserved words, (such as earlier versions of Scheme) you cannot make any assumptions at all about any subexpression starting with a symbol whose binding you do not know. Because of the parens, you can tell where its influence ends. But if you don't know the binding, you can't even guess from the fully-parenthesized prefix syntax whether it's first-class (a procedure) or first-order (a macro). So, not even the AST structure defined by the parens is necessarily as it appears within such a subexpression. Even more pernicious are symbols whose bindings you *think* you know -- but which may be shadowed by bindings imported from a module which you probably trust not to do anything "insane." I've heard the same argument against FORTH (which has even less syntax than Lisp) and about operators that don't imply the restrictions that they "ought to" in C++ etc because you have to know whether they're overloaded and if so, how. I think that it comes down to syntax -- known tokens and relationships between them with truly invariant meanings -- giving people "traction" to reason about code. A little syntax seems to have a significant effect on people's cognitive experience of a language and provides context enabling them to read unfamiliar code, or at least to rule out possible readings inconsistent with the invariant syntax. But how much does it help? What kinds of syntax provide the most clarity to the most people? Has anybody done comparative studies of syntactically different langauges with near-identical semantics and measured programmer effectiveness? Is there a shred of evidence, in other words, or is this effect merely anecdotal and speculative? Ray Dillinger By Ray Dillinger at 2011-06-21 04:06 | LtU Forum | previous forum topic | next forum topic | other blogs | 12186 reads
|
Browse archives
Active forum topics |
Recent comments
16 weeks 1 day ago
16 weeks 1 day ago
16 weeks 1 day ago
38 weeks 2 days ago
42 weeks 4 days ago
44 weeks 1 day ago
44 weeks 1 day ago
46 weeks 6 days ago
51 weeks 4 days ago
51 weeks 4 days ago