‹ BackHN Continuity

Thread

What makes Lisp difficult to read?

47 points · 81 comments · ibobev

  1. PaulHoule · · focus · HN ↗
    I tend to struggle with other people's indentation rules for code and other programming languages, like nobody liked my article that said you should carry indentation into embedded strings that represent other programming laguages like SQL

       result = sql.execute("""
          SELECT someColumn
          FROM thatTable
          WHERE anotherValue>55
            AND state='pending'
          ORDER BY createdDate
       """)
    
    Ultimately the idea is that indentation should be influenced by semantics, the intention of the code, and not just the syntax. Of course that is against the "one way to indent" philosophy of Go, Biome, and such... But I might accept less than optimal indentation to put an end to tab wars once and for all.

    I find indentation of Lisp always seems to fail at communicating in the semantics, much worse than other languages. Things like

       (if condition truePath falsePath)
    
    are scrambled when your eye skips over something. If the Lisp community got over its respect for tradition perhaps they'd develop some kind of syntax highlighting or tooltips or something that would clarify this sort of structure.

    About 90% of real language have subject-verb-object or subject-object-verb orders

    <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Subject%E2%80%93object%E2%80%93verb_word_order" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Subject%E2%80%93object%E2%80%9...

    verb-subject-object and verb-object-subject are more Lisp-like and represent 10% of languages including Standard Arabic, Finnish and Fillipino.

    I like extreme parsimony, like I&#x27;d love to write stuff like

       format = lambda: `%1-%2`
    
    but I think as complexity goes up depending on the meaningful order of elements breaks down in many ways and you need to give things meaningful names.
    1. pasc1878 · · focus · HN ↗
      For syntax highlighting try using a different colour for each level of indentation or parenthesis. I use prism-mode in emacs.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.