[erlang-questions] Erlang beginner questions

Mihai Balea mihai@REDACTED
Wed Apr 13 15:27:04 CEST 2011


On Apr 13, 2011, at 9:17 AM, Frédéric Trottier-Hébert wrote:

> As far as I know, behaviours are more than interfaces; they imply that divide between a generic and a specific bit of code, with the generic one being well-behaved and the specific one being relatively unsafe. Moreover, it also implies giving up the control of the flow to the behaviour module, restraining the callback module to specific details.
> 
> An Interface is much more generic and only has a meaning in terms of contracts in this particular case.
> 
> I might be taking a purist approach, but I think the distinction is important. I think behaviours are a rather poor tool to determine an interface itself compared to real contracts that could be enforced by the compiler or Dialyzer.

True, but I wouldn't go that far with someone who's just starting to learn about this stuff... 

Mihai




More information about the erlang-questions mailing list