Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn't it tiring to type so many parenthesis all the time? This is probably my first time encountering a Lispy language, other than Logo.


The number of parentheses is the same, they're just in a different place. Isn't it tiring to type so many semi-colons and commas all the time?


I think it's tiring because before every expression I have to type a (. It's not tiring to type semi-colors and commas because they are very well positioned on the keyboard and I don't have to reach out in the same way as I need to for the parenthesis.

Plus, there are not a lot of semi-colons and commas in JS and Python.


Replace in Python with 4-space / tab indentation.


I know a lot of people think that you write more parentheses in Lispy languages, but actually in most cases you just type them in a different order, e.g. instead of `foo(x, y)` to call a function, you type `(foo x y)` and you even save a comma.

Of course, there are constructs such as `let` and `cond` that are more parenthetically noisy (not so much in Clojure though), but on the flip side you don’t have to remember a lot of special syntax like in non-lisp languages.

Most Lisp-people also use structural editing tools like paredit[1], which make it really easy to write and edit s-expressions. I found that after some time I didn’t really think that much about parentheses anymore.

[1]: https://paredit.org


You're right about the order part and I didn't consider it initially. This is what Fizzbuzz looks like in Clojure:

  (defn fizzbuzz [n]
    (cond
      (zero? (rem n 15)) "FizzBuzz"
      (zero? (rem n 3)) "Fizz"
      (zero? (rem n 5)) "Buzz"
      :else (str n)))

  (defn print-fizzbuzz [n]
    (doseq [i (range 1 (inc n))]
      (println (fizzbuzz i))))
This looks overwhelming for someone who hasn't written any Lisp. My thought looking at this code was that I have to type a parenthesis before formulating any thought. Which is crazy because it's not some huge thing. It's like saying I have to press Enter before writing a line of Python.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: