What is the reason Lisp code is not written with closing parens on new lines?
1–10 of 14 posts
Re: What is the reason Lisp code is not written with closing parens on new lines?
#2It takes a few days for the shortcuts (http://www.emacswiki.org/emacs/PareditCheatsheet) to become second nature, but then you never really thinkabout the parentheses again.
Re: What is the reason Lisp code is not written with closing parens on new lines?
#3Re: What is the reason Lisp code is not written with closing parens on new lines?
#41. Lisp has a lot more parens than C or Java has curly brackets. The cost to vertical space is exaggerated. Otherwise you end up closing in a new line sometimes and not others, which quickly becomes distracting.
2. Somebody once said (anybody have the quote?) that C and java code looks blocky, while lisp code looks more fluid, like clay being moulded. That aesthetic speaks to me.
Re: What is the reason Lisp code is not written with closing parens on new lines?
#5I'm not sure if that long thread included my two favorite reasons before it turned flame-y: 1. Lisp has a lot more parens than C or Java has curly brackets. The cost to vertical space is exaggerated. Otherwise you end up closing in a new line sometimes and not others, which quickly becomes distracting. 2. Somebody once said (anybody have the quote?) that C and java code looks blocky, while lisp code looks more fluid,…
Re: What is the reason Lisp code is not written with closing parens on new lines?
#6Re: What is the reason Lisp code is not written with closing parens on new lines?
#7Re: What is the reason Lisp code is not written with closing parens on new lines?
#8Re: What is the reason Lisp code is not written with closing parens on new lines?
#9I'm not sure if that long thread included my two favorite reasons before it turned flame-y: 1. Lisp has a lot more parens than C or Java has curly brackets. The cost to vertical space is exaggerated. Otherwise you end up closing in a new line sometimes and not others, which quickly becomes distracting. 2. Somebody once said (anybody have the quote?) that C and java code looks blocky, while lisp code looks more fluid,…
I know I've read some seasoned Lisper insist that beyond a certain sized software project, good Lisp code will have fewer parentheses than good Java code has curly braces (owing supposedly to Lisp's potential conciseness). Of course, this could be an exaggeration or even a "no true Scotsman" argument. I haven't enough experience to know if the claim is plausible.
I am also a Scot - if that helps ;-)
Re: What is the reason Lisp code is not written with closing parens on new lines?
#10I'm not sure if that long thread included my two favorite reasons before it turned flame-y: 1. Lisp has a lot more parens than C or Java has curly brackets. The cost to vertical space is exaggerated. Otherwise you end up closing in a new line sometimes and not others, which quickly becomes distracting. 2. Somebody once said (anybody have the quote?) that C and java code looks blocky, while lisp code looks more fluid,…
I know I've read some seasoned Lisper insist that beyond a certain sized software project, good Lisp code will have fewer parentheses than good Java code has curly braces (owing supposedly to Lisp's potential conciseness). Of course, this could be an exaggeration or even a "no true Scotsman" argument. I haven't enough experience to know if the claim is plausible.
(if (= x 0)
(foo x)
(bar x))
And: if (x == 0) {
foo(x);
}
else {
bar(x);
}
The Lisp code has 8 parenthesis, whilst the Java code only has 4 braces. However, the Java code also has 6 parenthesis and 2 semicolons, so in total the Lisp code only has 8 control flow tokens, whilst the equivalent Java has 12 (or 13, if you count the 'else').