DEV Community

Discussion on: Java may be verbose, but who cares?

Collapse
 
ericnormand profile image
Eric Normand

Hey Dan,

Great post!

Years ago I was tired of people complaining about "so many parentheses". So I did some simple analysis of Java, JavaScript, and Lisp.

It turned out Java and JavaScript had more. Fewer per line, but more in total for the same functionality.

Then I analyzed other "brace" characters like square braces and curly braces. If you add all of those in, Java and JavaScript went through the roof.

It's unfortunate, but I think people who complain about # of parentheses are pointing at something real but don't know how to articulate it. Clearly, the # is not what's important. Perhaps it's the density? Just about every line of Clojure has at least one. Some lines close 5-10 at the end.

It could also be the uniformity. Most everything is done with parens in Lisp, so if you don't know what that first thing in function position is, it looks like a soup of parens.

Finally, it could be that people are used to braces being really meaningful syntax in their language. C-style languages use curly braces for blocks, parens for function calls, and squares for subscripts. If you are used to seeing those things as guideposts through the code, you'll be disappointed in a Lisp. Your intuition will misguide you and it will just look like a mess, as any foreign syntax would.

Rock on!
Eric

Collapse
 
danlebrero profile image
Dan Lebrero

Hi Eric,

Very interesting your thoughts about paren density and meanful syntax. Clojure's use of vectors help a lot on both.

I have given up on the parens discussion, as I have been on the other side of the fence and no amount of reasoning would convince me.

Nowadays I just brush the discussion aside with "you will get over it and you will love it. What other concerns do you have with Clojure?"

Plenty of times the discussion ends there, and one less convert for the Church of Lisp.

Thanks a lot for the comments!

Dan