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

Same here. I never understood why a paren on the left of a function name “looks like fingernail clippings” but to the right it’s “just how code works.”


We have to try to understand the non-strawman position of those who are genuinely turned off by Lisp syntax. The problem for them isn't the position of the parenthesis or the lack of commas: those things are probably fine for almost everyone.

In Lisps, this notation represents all structures in the program: definitions of functions, types and variables, control statements and so on.

For the users who have some kind of problem with that, it wouldn't be any better with the op(arg, ...) notation; and I suspect that most would agree that it's even worse.

(For that matter, most programmers don't actually have experience nesting the f(x, y, ...) notation to the same depth that is seen in Lisp programs. Anyone comparing a simple one-or-two-liner f(x, y, ...) with a modicum of nesting to Lisp code that runs for pages and pages is doing apples and oranges.)


Clojure takes this criticism to heart, and at least uses different delimiters for indicate different kinds of syntactic structures. Like () for classic lists, [] for arrays, {} for maps. Helps with visually detecting different kinds of structures in your code.


Clojure also prunes the excessive parentheses whenever the structure is obvious from context. E.g. "(let ((a 1) (b 2)) ...)" becomes "(let [a 1 b 2] ...)" and Clojure just requires an even number of elements so that the pairing can be inferred.


Common Lisp has this in the `setq` and `psetq` macros. E.g. exchange `x` and `y`:

  (psetq x y y x)
You can easily have a nesting reduced binding macro, like (var (x 1 y 1) (list x y)), with sequential binding.

Untested:

  (defmacro var (pairs &body body)
    (if (oddp (length pairs))
      (error "~s: variables and init-forms must occur pairwise" 'var))
    `(let* ,(loop for (var init) on pairs by #'cddr
                  unless (and var (symbolp var)
                              (not (eql var t))
                              (not (keywordp var)))
                  do
                    (error "~s: ~s isn't a variable name" 'var var)
                  collect (list var init))
       ,@body)))


Sadly, I'm not convinced that there is much more than the straw man, honestly. Folks are predisposed to think it is a hard to read language. And this is on large because everyone says so.

Similarly, python. Is only a readable language because the community insists it is.


Larry Wall's remark was less about prefix notation and more about how there's very little visual difference. I don't necessarily agree with the criticism because that's the price you pay for homoiconicity, and it's a price well worth paying; but it was a more serious complaint than "lmao parentheses".

See e.g. Clojure, that introduced #{} for sets, [] for vectors etc.


It's funny cause to me visual differences in syntax are just useless information overload. And another dimension of constraints to deal with. That's why I clinged to low syntax languages.. you write in semantics almost. The rest is problem solving (or even extending metadomain with macros or else to help yourself)


>that's the price you pay for homoiconicity

Well no but actually no. Mathematica is homoiconic, and it has tons of special syntax and sugar that all boils down to lists when you quote. Elixir also does this with a ruby-like syntax on top. Those are just the 2 I know of. Making the compiler available through a programmer-accessible API from within the program itself is the big idea, it has nothing to do with what the text grammar happens to be.


Another plus one here. The commas baffle me, as more languages decided to add optional trailing ones...




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

Search: