[erlang-questions] Why do we need modules at all?

Xiaopong Tran xiaopong.tran@REDACTED
Tue May 24 11:31:18 CEST 2011


On 05/24/2011 04:49 PM, Josh Johnston wrote:
> 
> 
> In a normal language this would be a problem, but in erlang we can get
> the desired behaviour by using pattern matching, right?
> 
> So instead of
> 
> 
>     to_html()
>     resource_exists()
>     etc
> 
> 
> We have
> 
> resource(to_html, ...)
> resource(exists, ...)
> etc
> 
> I'm not disagreeing with you - we do need some good way to do this. But
> I don't think modules are necessary in this case.
> 

Pattern matching might work here, but do away with modules and using
pattern matching would a heavier load on the programmer.

Modules or not, it does not have much effect on the VM, we can
just make the VM work without modules. But I think programmers
would have to work harder, distinguishing which function is which.

Although I don't really like the Erlang module, but I think it's
better with it than without.

Xiaopong



More information about the erlang-questions mailing list