3 ms·
Ask HN: Lisp's parentheses are bad but Elixir's `end`s are okay?
Why do people hate Lisp's parentheses so much, but they don't find this abomination a step back:
Example Elixir code:
defmodule A do
defmacro __using__(_env) do
quote do
defmodule Math do
def plus_itself(y) do
y + y
end
end
end
end
end
It also happens in Ruby and several other languages. Typing "end" is three key strokes whereas ")" is just one or two, depending on your keyboard configuration.
And IMO multiple "end"s are much uglier than multiple parentheses.
- m-onz 2y agoI like params and end.... I would happily use lisp or elixir... LFE is really cool.
- arrowsmith 2y agomeh, you get used to it.
- behnamoh 2y agoBut with parentheses we get the full power of Paredit and Parinfer, is there such a thing for Elixir's ends?
- taylodl 2y agoAnd in Lisp I can end an expression such as this with: ))))) which allows you to quickly see the expression has been ended. I think Lisp has had trouble when people attempt to use parenthesis as begin/end markers and put them on separate lines and try to line them up vertically. Don't do that!
- behnamoh 2y agoI guess you use Parinfer and structure editing, which is really cool!