[erlang-questions] erlang sucks
Lennart Öhman
Lennart.Ohman@REDACTED
Tue Mar 11 22:14:06 CET 2008
I am compelled to "help" Sean. Further, I feel there is a difference
between to pattern-match a branch decision, and to do logical tests.
Example of perfectly legal but in my opinion ugly code (where 'if' or
using guards in a function-head of a help function is the correct
solution):
case X of
X when X>10 ->
:-)
Lennart
---------------------------------------------------------------------------
Lennart Öhman phone : +46-8-587 623 27
Sjöland & Thyselius Telecom AB cellular: +46-70-552 6735
Hälsingegatan 43, 10th floor fax : +46-8-667 8230
SE-113 31 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED
-----Original Message-----
From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Sean Hinde
Sent: den 11 mars 2008 20:18
To: Mats Cronqvist
Cc: Erlang mailing list
Subject: Re: [erlang-questions] erlang sucks
On 11 Mar 2008, at 12:47, Mats Cronqvist wrote:
>
> * 'if' is completely worthless, and should ideally be obsoleted.
No, no no! I like 'if' It allows some neat constructs that are
horrible with case.
Counting 'if' and 'case' for one of the apps in our codebase gives
this result:
alex:src sean$ grep -v '^[[:space:]]*\($\|%\)' $(find . -name "*rl") |
grep " if " | wc -l
345
alex:src sean$ grep -v '^[[:space:]]*\($\|%\)' $(find . -name "*rl") |
grep " case " | wc -l
1052
~ one quarter of branching constructs are 'if'. Not at all
insignificant.
Sean
_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://www.erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions
mailing list