Earlier quoted context omitted.
Interesting. While Elixir syntax definitely requires writing more code, than for example Ruby which I use the most, I have not been struggling too much. Could you give some examples of these long, problematic snippets? Also, what are the other things you did not like about Elixir/Phoenix? I am really curious to hear about them since, here on HN they are mostly praised and I wonder myself what are the cons (my experie…
$ irb [1, 2, 3, 4]. select {|n| n % 2 == 0}. map {|n| n * n}. reduce {|sum, n| sum + n} # 20 vs $ iex [1, 2, 3, 4] \ |> Enum.filter(fn(n) -> rem(n, 2) == 0 end) \ |> Enum.map(fn(n) -> n * n end) \ |> Enum.reduce(0, fn(n, sum) -> sum + n end) That Ruby code is so compact that I split it on multiple lines only to make the comparison easier. Even Python is more compact even if it's harder to read because of the reverse…
+/{(0=2|⍵)×⍵*2}⍳4
20Edit: My point here, besides simply the joy of trolling, is that "compactness" isn't a great metric for analyzing a programming language, or a framework even. My APL example isn't very compact for APL, yet it's certainly /way/ more compact than the Python, Elixir, or Ruby versions.
Still, it's hardly comprehensible to me as a beginner APL programmer -- and I wrote it, just now. It's probably /completely/ incomprehensible to anyone who hasn't written APL before. Is APL still "better", going only by compactness?