Re:Damien Katz: What Sucks About Erlang
by jey on Sunday March 09, 2008 @09:09PM
(#132833)
Why write this:
When you can write this? (I assume this is legal)
[ Parent
| on HN ]
Re:Damien Katz: What Sucks About Erlang
by mechanical_fish on Monday March 10, 2008 @08:54AM
(#133100)
I think this is just toy-example syndrome. In my experience the real-world example looks more like this:
f(X) ->
X1 = foo(X, "Blah blah blah", true, :definitely, :ack),
X2 = fab(X1, X, sizeof(X), X-1, bar(X, "martini"), :with_bells_on, :pdq),
X3 = bar(X2, "fim tim lim bim whim bim bus stop"),
baz(X3).
Try chaining that and see how readable it is.Touché.
Sometimes shorter lines are easier to read. But in most of the cases you should be right. You can even be more consice by using point-free form:
f = baz . bar . fab . foo
[Haskell syntax - sorry, I do not know enough about Erlang - but something like this should be possible.]