News for hackers. Stuff that matters.
Re:Lisp in Space by behnamoh on Sunday August 06, 2023 @11:15AM (#37022850)
For me, (...) are not the problem. But the thing that throws me off and confuses me when I read Lisp code is the excess use of long words. The language is too verbose for its own good. When I read Python or other languages, the space between the expressions/statements makes it much easier to follow the flow and understand what's going on. In Lisp, I often see lines stacked together with minimal room for my eyes to "rest".
Re:Lisp in Space by gumby on Sunday August 06, 2023 @12:16PM (#37023492)
As a long term (40+ year) Lisp developer I carry that forward into my other languages. Vertical whitespace is free in lisps,* as with most languages, so what I try to do us clump together an "operation" ideally so that it fits in my fovea when when I'm glancing at the code. So a quick glance tells me "this isn't what I'm looking for" or alternatively "all this goes together so read the whole thing before changing anything, but there's a good chance your change won't affect other parts of the function."

Thus: (if (< foo 0) (do-this) (do-that))

or if it's long

   (when (< foo this)
     (some-stuff)
     (more-stuff)
     ...)
Obviously one can do this in C++ by introducing a block, but it isn't as syntactically natural; a block implies that there is important RAII involved, so usually I just do it by "vertical clumping"

I find the standard c style (used by lots of languages) actually spreads the code out too much, emphasizing the curly braces rather than the code itself. (this is a local version of the OO+IDE plague that smears functionality across lots of tiny files.

This sense of locality is presumably why the gnu programming style is compact in some ways and expansive in others, different from K&R style, for example,

return-type function-name ( type1 arg1 ) {

allows the eye to see the identifiers without the syntactical markers () and {}, letting indentation and vertical whitespace to tell a story.

* except, de facto, Interlisp because it normally used a structure editor rather than a text editor.

Re:Lisp in Space by kazinator on Sunday August 06, 2023 @02:00PM (#37024759)
Classic old Lisp doesn't have the problem of long words: it has mostly short words like atom, cons, car, cdr, array, ...

Then, eventually, along comes Common Lisp with symbols like multiple-value-bind and update-instance-for-redefined-class.

I made a dialect called TXR Lisp in which most of the important symbols in the standard library are deliberately quite short, to avoid this readability/writability issue.

Lisp code often avoids vertical breaks within sections in a function, because many constructs nest, and so the nesting and indentation separates them already, like:

   (while ...
     ...
     (let ...
       ...))
   (while ...
It's like point form:

   - abcde
     - efgh
     - jlk
       - mn
   - next point