‹ BackHN Continuity

Thread

What makes Lisp difficult to read?

47 points · 81 comments · ibobev

  1. whalesalad · · focus · HN ↗
    Personally, I find that a lot of LISP hackers put way too much logic into a single form or method rather than breaking it into smaller components that can be composed together. And I think that's often why we see frustration with LISP is that you'll have something that is indented really deep when it could be a much smaller function that's leveraging other functions. It's even worse in certain lisps like Clojure, where you'll see a lot of shorthand symbolic stuff, like for anonymous functions, or when you're using core.async, where you look at it and you think, is this brainfuck?
    1. joshlemer · · focus · HN ↗
      And the reason that LISP code tends to be reluctant to split things out into multiple forms with variable assignment IMO is because it introduces a new level of nesting. It's too much friction to go from

          (defn foo [] 
             (+ 1 2))
      
      to

          (defn foo []
            (let [x 2]
               (+ 1 x)))
      
      I wish that there were some kind of macro available in Clojure that would provide a local "def" kind of functionality that doesn't pollute the namespace and just creates a binding in the parent scope. So that you could do something like:

          (defn foo []
             (let! x 2) 
             (+ 1 x))
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.