‹ BackHN Continuity

Thread

What makes Lisp difficult to read?

47 points · 81 comments · ibobev

  1. perrygeo · · focus · HN ↗
    > I have not yet encountered a fully satisfying explanation as to why Lisp is perceived as being less readable.

    Difficulty is, by definition, relative to one's skill. You cannot so quickly discount the fact that 99% of programming is taught in Java/C style language syntax. If you've had lifelong exposure to Lisp, you might feel exactly the opposite. The author does a poor job of justifying why these pop-cognitive-psych theories should have more weight than prior exposure.

    Personally, as someone with decades of exposure to both styles, I look at the factorial example and see everything I love about Lisp syntax - consistent, no magic keywords and syntax to memorize, it represents a tree just like my mental model of code, there's no way to fall through and forget an else, expressions instead of statements, no early returns ... literally everything about the Lisp example is more readable to me. YMMV.

    1. convolvatron · · focus · HN ↗
      every time I get to use lisp syntax I feel a sense of relaxation, as if the background stress of thinking about precedence and the meaning of all these magic sigils and control flow constructs just melts away and I can finally see clearly what's going on. my first professional programming language was lisp, and almost every single project in the 35 years afterwards was C style. but it still feels like home.
    2. Supermancho · · focus · HN ↗
      > Difficulty is, by definition, relative to one's skill

      It's a factor and not the sole factor. Saying it's "by definition" is incorrect.

      > The author does a poor job of justifying why these pop-cognitive-psych theories should have more weight than prior exposure.

      There's no reason to believe either way, except one path has decades of evidence. Human behavior is not overcome by programmatic "elegance". The dismissive "pop" prefix is signaling bias.

      > no magic keywords and syntax to memorize

      ie no syntactic sugar. Pointless repetition is counter productive.

      >a there's no [logical] way to fall through >b [no way to] forget an else, >c expressions instead of statements >d no early returns

      b. The interpreter catches it. d. Pointless execution is counter productive.

      > literally everything about the Lisp example is more readable to me

      That's a single data point. Statistically it's worse, but you're practiced and apparently still physically able to quickly discern the nested count (or use an IDE). Yet another example of a position that is counter to existing studies. Heavy nesting is error prone, even when a program compiles (eg Monden et al., “Evaluating the Applicability of Reliability Prediction Models between Different Software,” ISSRE 2001)

      1. perrygeo · · focus · HN ↗
        Of course it's a single data point, stating my personal preference and the objective characteristics of the code that make it more readable, to me. That's what the article did too! But they tried to use their biases to establish a claim on objective truth. That's the difference - I'm not trying to make a generalizable scientific claim!

        I'm trying to say that making such claims in the first place is invalid.

        There is no language that is objectively more or less readable. Yes, I've read the studies. No, none of them come close to adequately addressing the confounding factor of prior exposure/education. A randomized controlled trial starting from childhood could establish such truths, but such an experiment has not been done. Until then, small-n studies that don't address this flaw in any way yet continue to make broad claims - "pop" science is perhaps not dismissive enough.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.