# Understanding @behaviour

**URL:** <https://forum.elixirforum.com/t/understanding-behaviour/25300>\
**Category:** Questions\
**Tags:** learning-elixir\
**Created:** [September 10, 2019, 3:14pm UTC](https://forum.elixirforum.com/t/understanding-behaviour/25300 "2019-09-10T15:14:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![peerreynders](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/32/5826_2.png) [@peerreynders](https://forum.elixirforum.com/u/peerreynders)\
**Post date:** [September 10, 2019, 4:44pm UTC](https://forum.elixirforum.com/t/understanding-behaviour/25300/5 "2019-09-10T16:44:23Z")

</div>

FYI:

> [@Behaviours in Javascript?](https://forum.elixirforum.com/t/behaviours-in-javascript/22668):
>
> I really like to use [behaviors](https://elixir-lang.org/getting-started/typespecs-and-behaviours.html#behaviours) in Elixir but now I have to work with Javascript so I don’t have them. Is there a library that would let me have this functionality? Or maybe there is a native solution for this?

> [@History of Behaviours?](https://forum.elixirforum.com/t/history-of-behaviours/19588):
>
> I know there are some Erlang old timers here, who might know - what is the history behind the behaviour syntax / idea? From a semantic point of view I could say that we could just send callbacks into a specific ‘behaviour’ function to setup / do our work for us.. Perhaps they were easier to pick or learn than sticking lambdas in function arguments / dependency injection..? Did the idea originally come from elsewhere? OO interfaces, are obvious, but they don’t seem super compelling when you a…

> [@Why are behaviour methods referred to as "callbacks"?](https://forum.elixirforum.com/t/why-are-behaviour-methods-referred-to-as-callbacks/20135):
>
> Coming from an OO background, my first reaction is to think of behaviours as interfaces. So it makes sense that a module must define one or more functions outlined in a behaviour if it wishes to implement that behaviour. So why in Elixir are the behaviour’s functions referred to as “callbacks”? In other languages, a “callback” has quite different connotations which have little to do with inheritance. In fact, the page at [https://elixir-lang.org/getting-started/typespecs-and-behaviours.html](https://elixir-lang.org/getting-started/typespecs-and-behaviours.html) h…

---

_[View the full topic](https://forum.elixirforum.com/t/understanding-behaviour/25300)._
