Have a gloriously wonderful day =)
Have a gloriously wonderful day =)
(setf x 5)
is a piece of code that is truly and immediately represented by a data structure (a list containing the symbol SETF, the symbol X, and the number 5).Let's do a routine example. In your editor, how would you get from
(f x (y|)) z
to (f x y| z)
if the '|' was your cursor? Maybe you think you should click around and delete the right parentheses, and carefully balance them. With structural editing, a Lisp programmer might first do a "splice": (f x (y|)) z
;; splice: press Alt+s
(f x y|) z
and then they will do a "slurp" (slang for moving the next thing after the cursor into the current enclosing parentheses): (f x y|) z
;; slurp: press Control-<right>
(f x y| z)
We've managed to get to our destination by using only two structural commands that makes a parenthesis-mismatch error fundamentally impossible.These are examples written with a package called "Paredit" in mind, and it actually makes editing Lisp a distinct joy compared to character-based editing of other languages. Some Lisp programmers prefer slightly different styles of structural editing, but they all reduce to the same motivations: Edit a Lisp program's structure, not its characters.
So, contrary to popular belief, Lisp programmers do not count parentheses. Lisp programmers' eyes do not glaze over at the sight of Lisp. Syntax errors are probably a <1% occurrence out of all of the errors one encounters. Though purely informally empirical, I'd be willing to get that syntax errors are far less common in Lisp compared to syntax-rich languages like C++, Haskell, etc.
People who dabble with Lisp for 15 minutes in notepad.exe invariably run into syntax errors, but that is not a reflection of what serious hobbyists and professional Lisp programmers do.
Have a great day =)
Lisp has a readability issue
which I interpreted a statement of generality, but I think you meant Lisp is difficult for me to read
which I have no business arguing against, except to offer you guidance on what I believe are best practices for reading and writing Lisp. (In short, it's to use an editor specifically equipped to write Lisp. It gives you canonical indentation and structural editing. Emacs is the most popular choice, but there are extensions to Vim and VSCode; as well as full-blown commercial IDEs (plural!) by LispWorks and Franz Inc.)You would not be upset, unless deep down you also agree this was true.
Having someones opinions disrespected under the guise of a off-topic counter-argument, doesn't sound much like a prize.
Here is an up-vote, and have a wonderful day. =)
And I genuinely still like you, even if you think the world is a terrible place. =)
Have a wonderful day =)
1. I spend more time programming C than Lisp, but am more prone to syntax errors in C than lisp, so my experience is quite different than yours
2. Syntax bugs have little to do with readability; that has more to do with writeability.
3. Most languages make it possible to write code that is inscrutable, but that is not necessarily an indictment of their readability.
2. unless some clown thought conditional tail recursion was super awesome for the next guy.
3. All code is terrible, but some of it is useful... and if it is only useful to a few than it fails as a language.
Keep in mind I learned on an RPN machine, so understand the sirens song lisp sings. ;)
Lisp, C, Java, C++, Python
It all depends, e.g., C++ would rank higher in a very high quality code base.Or do you just prefer reading the structure in prefix notation.
Tail recursion is non-idiomatic in Common Lisp; both because the standard does not guarantee tail-call elimination (as opposed to, say, Scheme) and because dynamic-binding, which is idiomatic in Common Lisp reduces the number of calls that are in a tail position.
Also, tail-recursion is entirely divorced from syntax; perhaps you meant semantics? For example GCC will optimize tail calls in a rather broad number of contexts.
You may have confused interesting with useful...
Have a nice say ;)
And you, of course, have study that proves it, right?
Enhance your calm. =)
Googling "python syntax error"
"About 172,000,000 results (0.46 seconds)"
???
Again, depends on the intended use-case. =)
Python is 48.07%
Lisp doesn't even show up in lists ;)
I like data, but the hate in this place is unbelievable.
Have a great day, and happy computing my friend. =)