[erlang-questions] erlang sucks

Jani Hakala jahakala@REDACTED
Mon Mar 17 14:31:41 CET 2008


attila.rajmund.nohl@REDACTED writes:

> I don't think that immutable variables make it easier to write less
> buggier code. On the contrary, I often see code like this:
>
> HR1=f(HugeRecord),
> ...
> g(HR1).
>
> Then someone adds a line to modify the HugeRecord and forgets to update
> the call to 'g':
>
> HR1=f(HugeRecord),
> HR2=f2(HR1),
> ...
> g(HR1).
>
> Now we have a stupid bug.
>
The compiler would warn about that
    Warning: variable 'HR2' is unused

Jani Hakala
-- 
University of Jyväskylä, Department of Physics
email:  jahakala@REDACTED



More information about the erlang-questions mailing list