3 ms·
If Hal Abelson and Jerry Sussman can use Lisp syntax to teach an iconoclastic, supremely philosophical class about programming that must rank amongst the best e
by metroholografix 4y ago
If Hal Abelson and Jerry Sussman can use Lisp syntax to teach an iconoclastic, supremely philosophical class about programming that must rank amongst the best ever conceived and taught, 40 years ago, with blackboards and pieces of chalk, your average newcomer to Lisp should breeze through the process today.
I've met a lot of folks that seem to possess mental models that are fundamentally mismatched with what Lisp expects: It's not just the syntax but a lot of the base models of the language that demand an open mind and time involvement before they get imprinted. And at least in some cases, blaming the parens becomes the easy way out of why one doesn't get it.
- jepler 4y agoOn a blackboard it didn't matter whether all the parentheses matched all the time
- metroholografix 4y agoWhat matters on the blackboard (or a book) is "understanding" and that is not affected by a missing paren or two (which is a testament to Lisp's regularity of syntax). When they wanted their programs executed by a computer, their editor -Edwin- matched parens, exactly like how one would do it today, or even easier with things like Paredit.
- wrycoder 4y agoAnd if you leave out a paren, the resulting auto-indented structure will look obviously wrong, signalling that you made an error. It's not so obvious in Python when you make an indentation error in a complicated if/elif/else structure.
- kazinator 4y agoIn a language with a sane syntax, we can do this: if (A) { if (A) { B B C --> C } D D E E } Imagine that is 300 lines long and BCDE contain their own nesting and such. We can do a "git diff -w" and just see that the closing brace moved and that there are no changes in D and E. Do the same in Python and "git diff -w" comes up empty.
- teddyh 4y agoI’ve watched those videos. IIRC, the parentheses always matched.
- wrycoder 4y agoIt's not the parentheses or the Polish notation that matter. Those are covered in the first chapter of any Lisp/Scheme book and they are trivial, especially with a proper editor that understands structure and will indent unambiguously accordingly. Unless you're stuck on simple editors like Notepad or Nano, there's no issue here. What's more challenging in Scheme, as Abelson and Sussman teach it, is the use of recursion instead of looping and in particular understanding that recursion is only equivalent to looping when the recursion is in "tail position", i.e. when there is nothing left for the calling function to do except return to its own caller. Common Lisp style tends to use looping, not recursion.