3 ms·
"Oh well, at least he didn't complain about lisp having too many parenthesis." Humans are visual creatures. It really is easy to get lost in Lisp's parentheses
by Teckla 16y ago
"Oh well, at least he didn't complain about lisp having too many parenthesis."
Humans are visual creatures. It really is easy to get lost in Lisp's parentheses.
Languages whose blocks are easier to identify at a glance really are easier to read.
The attitude of far too many Lisp developers seems to be that Lisp has failed to dominate after all these many decades because people are just too stupid to realize how great Lisp is.
If Lisp hasn't dominated by now, rather than arrogance and superiority, it would be better to think about why Lisp continues to fail to dominate.
By the way, I'm not suggesting you're one of those people.
- silentbicycle 16y ago> Languages whose blocks are easier to identify at a glance really are easier to read. Which is why conventions for indenting Lisp code to show block structure have been established for decades. This problem has been solved for longer than Python has even existed. I don't know why people keep bringing it up. Lisp isn't perfect, sure, but this is a very weak criticism. Besides, what about mismatched delimiter problems in languages like C that have shift-reduce conflicts? Dangling else problem (http://en.wikipedia.org/wiki/Dangling_else http://en.wikipedia.org/wiki/Dangling_else), anyone? It seems disingenuous to complain about mismatched parens in Lisp when those are trivially handled by most decent editors, and the problem is in no way unique to Lisp.
- Locke1689 16y agoPython would argue that if the primary operating factor in readability is block structure and indentation one should simply add block structure and indentation as a mandatory part of the language and then remove cruft which is no longer necessary.
- silentbicycle 16y agoI'm not convinced that block structure and indentation are primary readability factors, just noting that Lisp programmers established conventions to address that problem long ago.
- Locke1689 16y agoThat's fair. I'm not saying Python's way is better or Lisp's way is better. I'm a long-time Python programmer but I'm also working on the Racket code base. I was simply pointing out a difference in philosophy, not taking sides. I mostly believe that the debate is a minor stylistic one and there are trade-offs in both directions. This is fundamentally similar to the way I see arguments for and against Python syntactical whitespace vs. Ruby-esque blocks.
- euccastro 16y agoPython doesn't mandate block structure and indentation in lines within brackets and parens. Ask yourself why is that and you'll have the reason why it makes sense in Lisp. I'm very familiar with Python and hack occasionally in Scheme. After a really short time, parens really are no problem. They are an asset. In big functions where indentation stops being obvious at a glance (and in smaller ones, what's the problem?), I can more easily see/check the extent of a block in Scheme (with editor paren matching) than in Python. The editor is better able to help me select and operate on such blocks. Moving blocks around (e.g. for refactoring) is easier, faster and feels safer. If I still use Python more often than Scheme it has nothing to do with parens. Much on the contrary, that's one of the reasons I wish I could spend more time in Scheme.
- Locke1689 16y agoPython doesn't mandate block structure and indentation in lines within brackets and parens. Ask yourself why is that and you'll have the reason why it makes sense in Lisp. Because they screwed up? I think indentation like the following should be mandatory across multiple lines: fun_a(long_arg_a, long_arg_b, long_arg_c)
- euccastro 16y agoAnd does that remove the need for parentheses? ;) Because actually, it gets more complicated than that. Sometimes it makes more sense to say: def open_window(x, y width, height, resizable=True, caption="") Without parens, is x, y a tuple or two separate arguments? And do I want to remember that? Also, what's inside the parens could have been a generator expression, which could have been conceivably partitioned in more than one sensible way, and which could have subexpressions with parens or brackets itself. Sounds contrived? I do it all the time and it often looks and reads just fine. I'm not arguing against your indentation rule, which is the one I use, and not even against the proposal of making it mandatory (although I'm not sure that in the heat of refactoring I'd appreciate the unnecessary SyntaxErrors), but about the point that making it mandatory would make parens unnecessary.
- stcredzero 16y agoLanguages whose blocks are easier to identify at a glance really are easier to read. IMO, it's really pointless to toss about theories having to do with readability for this reason or that. Programming languages are also (sub)cultural entities. It doesn't matter how many clever reasons we come up with explaining why people don't like this or that about whatever language. Most of those things are unsubstantiated, so who gives a flying expletive? What matters is that languages attract audiences of the size they attract. It's a fact of life. It's all we know until some serious psychological/linguistic research happens. Frankly, I'm not sure if enough people care enough about what coders think for it to happen. Maybe they should. In the meantime, we should just shut up and code. (Starting with me. Why did I write so many comments today?)
- cesarm 16y agoin lisp one ends up reading code by indentation - much like python. the parenthesis fade into the background after just a couple of days of using lisp. matter of fact i use a light blue background in emacs, and make the parenthesis a light gray. barely see them.