[erlang-questions] stuck at a exercise

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Mon Jan 26 15:47:32 CET 2015


On Mon, Jan 26, 2015 at 3:24 PM, Leonard Boyce <leonard.boyce@REDACTED
> wrote:

> I'm sure to get some hate for this, but I often find it easiest to
> explain in imperative programming terms to people new to the language;
>
> module == class
> public methods go in -exports([])
> private methods are not exported and are only callable from within the
> module itself
>

The only problem with such an explanation is that it isn't precise, which
may lead people to make the wrong train-of-thought later on in the process.
The imprecision is due to how many OOP-languages conflate different
concepts[0] such as class, module, encapsulation, namespace, scope, and
package into the very same thing. In Erlang, you would only ascribe some of
those properties to a module, but not all of them. Also, the term "class"
means different things depending on your programming language background.
And some languages with OOP concepts do not have a notion of class, while
they do have the module concept.

On the other hand, it may propel some learners to a better position
quickly, so it falls both ways.

[0] Even the concept of OO is not that well defined. I love to point out
Jonathan Rees on OO: http://www.paulgraham.com/reesoo.html in which he
describes how different OO concepts are cherry picked to form the viewpoint
that *your* language is object oriented.

-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150126/d40fb940/attachment.htm>


More information about the erlang-questions mailing list