This is an old revision of the document!
Table of Contents
Notes on Teaching and Learning Elixir
Ordering for teaching functions
<html> <blockquote class=“twitter-tweet” data-lang=“en”><p lang=“en” dir=“ltr”>Right now everyone teaches anonymous functions first because they are easier to express in iex. Here's our ordering: <br><br>1. We introduce the concept of a module. Not coding, just the concept. <br>2. Invoking M.f() in a module<br>3. defmodule/def. <br>4. Pipes. <br>5. Anon f.<br><br>I ❤️ this order</p>— Bruce Tate (@redrapids) <a href=“https://twitter.com/redrapids/status/1121022240047403008?ref_src=twsrc%5Etfw”>April 24, 2019</a></blockquote> <script async src=“https://platform.twitter.com/widgets.js” charset=“utf-8”></script> </html>
By Bruce Tate:
- We introduce the concept of a module. Not coding, just the concept.
- Invoking M.f() in a module
- defmodule/def.
- Pipes.
- Anon f.
Preferred method
Method
<html> <blockquote class=“twitter-tweet” data-lang=“en”><p lang=“en” dir=“ltr”>"If you want to teach someone a real skill, teach him how to fail. He will never learn it in school." - <a href=“https://twitter.com/nntaleb?ref_src=twsrc%5Etfw”>@nntaleb</a></p>— Nassim Nicholas Taleb's Wisdom (@TalebWisdom) <a href=“https://twitter.com/TalebWisdom/status/1134230061270405120?ref_src=twsrc%5Etfw”>May 30, 2019</a></blockquote> <script async src=“https://platform.twitter.com/widgets.js” charset=“utf-8”></script> </html>
Calling functions
By arity
Zeroary functions
alias :math, as: Math