‹ BackHN Continuity

Thread

What makes Lisp difficult to read?

47 points · 81 comments · ibobev

  1. whartung · · focus · HN ↗
    The parentheses are large glyphs that distract the eye, and do not stand out (to the untrained eye) as delimiters.

    Consider:

      (defun split-line (line)
        (remove-if #'(lambda (word) (string= word ""))
                   (split-sequence:split-sequence #\Space line)))
    
    Now imagine if we had some "lower weight" glyph besides the paren.

      .defun split-line .line,
        .remove-if #'.lambda .word, .string= word "",,
                   .split-sequence:split-sequence #\Space line,,,
    
    Obviously a contrived example replacing () with ., but you can see how "heavy" the parens and how they can dominate what the eye sees.

    With experience, the parens vanish. The parens being large and common take control of the conversation more than they should.

    1. whalesalad · · focus · HN ↗
      I don't think the parens are the issue.

      But when your function ends with ))))))))) -- that is the issue. Too much shit is being shoved into one method. But this is not the fault of lisp, it's the fault of the programmer who is wielding it.

      1. kccqzy · · focus · HN ↗
        That is frankly not a problem at all. People rarely bat an eye when your Python function ends by having eight simultaneous levels of dedent. People definitely don’t bat an eye when your HTML ends with </span></span></div></div></td></tr></table></section></body></html>. All you need is just good indentation, which is enforced in Python but optional in Lisps; then lazy programmers take shortcuts and don’t indent at all.
        1. whalesalad · · focus · HN ↗
          We can agree to disagree
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.