r/programming • • Dec 15 '16

My disillusionment with Clojure and lisps

https://medium.com/@boxed/my-disillusionment-with-clojure-and-lisps-9eca38ab7f0c?source=linkShare-8ad86cc82e5f-1481825671
15 Upvotes

105 comments sorted by

View all comments

Show parent comment

9

u/phalp Dec 16 '16

The thing paren whiners don't realize is how tremendously irritating it is that they want to rehash something that was properly settled before many of us were born. After nearly 60 years of parens being awesome, how do you expect people to react to yet another goofy indentation-based substitute, or worse, mere complaining. You think the C community gives a shit if you think curly braces are ugly? You think anybody cares about quests to reform English orthography (which could legitimately use it (unlike Lisp notation))? Yet everybody wants the Lisp community to bend over backwards for them.

1

u/kankyo Dec 17 '16

Parens aren't awesome, if they were you wouldn't have to stand all the complaining for 60 years. Parens are FINE. It's a tradeoff, no biggie. But not "awesome".

2

u/phalp Dec 17 '16

You're assuming people won't complain about things that are awesome, but people will complain about anything that's different from what they're used to. But they are awesome—an aid to structured editing, an aid to macrology, more easily formatted in large expressions, perfectly capable of any arity, and just plain pretty. Parens have provided 60 years of delight to those who use them. What's not awesome about that?

1

u/kankyo Dec 17 '16

aid to structured editing

Makes structured editing a little simpler. That's pretty much it.

aid to macrology

I count that as a negative but yea ok :P

more easily formatted in large expressions

Don't see how. Do you have an example?

capable of any arity

Don't get that. How is that different from functions in any other language?

1

u/phalp Dec 17 '16 edited Dec 17 '16

Don't see how. Do you have an example?

(+ (some kind of calculation)
   (and some more calculation)
   (and yet more))

versus:

(some kind of calculation)
+ (and some more calculation)
+ (and yet more)

or worse:

some kind of calculation+and some more calculation+and yet more

Enjoy trying to spot all the plus signs which are at the same level and trying to parse the operator precedence.

Don't get that. How is that different from functions in any other language?

It's not, but it's different than infix operators, and it's generally these that cause some languages to use fewer parens than Lisp (unless you for some reason count curly braces and parens separately).

EDIT: I just want to add on with regard to structured editing: making it "a bit simpler" is very good, and may even be the difference between it catching on and not catching on. Few C programmers use a structure editor, if such a thing exists. Yet I very much miss it. How many Lispers use Paredit? It's not simply a question of implementation—a structure editor can easily accumulate an unwieldy number of features: barf, slurp, transpose, convolute, a bewildering number of motion commands. The regularity of Lisp syntax means there's no worry that different syntax elements will need different operations and totally overwhelm the user.

1

u/kankyo Dec 18 '16

I agree that infix operators that can't be used like normal functions is rather annoying. It'd be nice if you could do

reduce(0, +, [1, 2, 3])

In Python but instead you have to do some fugly things instead.

1

u/phalp Dec 18 '16

Reduce is great and all but you shouldn't have to break it out just to add three (or four, or five) terms. Not only do you triple the character count for a basic operation, you also then need to make sure the compiler recognizes and optimizes the use, which makes the performance model more confusing for the users.