News for hackers. Stuff that matters.
Re:Damien Katz: What Sucks About Erlang by jey on Sunday March 09, 2008 @09:09PM (#132833)
Why write this:

  f(X) ->
    X1 = foo(X),
    X2 = fab(X1),
    X3 = bar(X2),
    baz(X3).
When you can write this? (I assume this is legal)

  f(X) ->
    baz(bar(fab(foo(X)))).
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.
Re:Damien Katz: What Sucks About Erlang by jey on Monday March 10, 2008 @05:38PM (#133467)
Touché.
Re:Damien Katz: What Sucks About Erlang by eru on Monday March 10, 2008 @08:39AM (#133096)
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.]