Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Elixir tutorials #324

Closed
wants to merge 4 commits into from
Closed

Conversation

Maikon
Copy link
Contributor

@Maikon Maikon commented Nov 20, 2016

Hey everyone 😃

This is an initial draft for adding the Elixir tutorials and to get some thoughts/feedback from the community.

The roadmap is the following:

  • Introduction to Elixir and Functional Programming
  • Installing Elixir
  • Interactive Elixir (Introduction to IEx)
  • Elixir Basics (data types/structures)
  • Expressive Elixir - Thinking in Patterns
  • Expressive Elixir - Functions and the Pipe operator
  • Recursion
  • Introduction to Mix (starting a new project)
  • Testing

I also wanted to explain my approach with these tutorials which is based on personal experience, both at teaching at Codebar as well as my own apprentices at 8th Light. It's also influenced by this blog post. The goal is to have small tutorials that cover one new concept at a time. This enables the student to achieve small wins and reinforce the feeling of achievement more frequently.

What would be nice is if we can think of an exercise which can be broken down into sections where each section is covered in one of the above lessons and at the end the student ends up building a nice little project that would otherwise be too big to complete in one lesson.

Any feedback on any of the above would be great 😃


Now type the expression `1 + 1` and press enter. You should see `2` printed
on the screen. You may have noticed that you can type another expression
now, for example `1 - 1`. A REPL therefore _reads_ an expression like `1 +

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this a bullet-pointed list of each step after "therefore", I think it will highlight what you're saying nicely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks Baris!

You can also ask more specific questions like what a particular function
does:

```erlang

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure Elixir is now a supported language.

IO.puts "Maybe?"

@barisbalic
Copy link

This is cool, definitely keep it up.

that will transform that piece of fish into sushi:

```erlang
make_sushi(🐟) -> 🍣
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the emojis!! 😍

only need to keep two things in mind: _functions_ and _data_. By _data_ we
mean _information_ and you can think of _functions_ as _actions_ that can
be performed on specific pieces of information. Seeing the world through
these two ideas will help you see problems in a different light and often
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe concepts would be a better word here instead of ideas

underneath.
[Erlang](https://en.wikipedia.org/wiki/Erlang_(programming_language)) was
created to solve a very difficult problem-that of telecommunications. As
such it has some characteristics that make it a very good language for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small typo, makes it as opposed to make it

Try the following inside IEx:

```erlang
Integers.digits(123)
Copy link
Contributor

@matyikriszta matyikriszta Nov 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be

Integer.digits(123)

Integers.digits() gives me a UndefinedFunctionError

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch!

specific things. It can even tell you things about itself! (try `h(IEx)`)

Many common things that you will be using live inside modules like the
`Integer` module we showed above. You can even ask a module about what
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really getting the meaning of this sentence Many common things that you will be using live inside modules like the Integer module we showed above. I think you showed one thing (digits) so it's a bit confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm..I see you what you're saying Kriszta. I wanted to stay consistent with the theme of functions seen as actions. Would something like this be better: Many common actions that you will be using on different data, often live inside modules that are associated with that data or is this still confusing?

```

Another way that you can get the available functions of a module is by
typing the name of the module with a dot at end like so: `Integer.` and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small typo: ...the name of the module with a dot at the end like so...

Copy link
Contributor

@matyikriszta matyikriszta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted a few minor things, mostly typos here and there. This looks really great otherwise!

@Maikon Maikon changed the title Add first 3 tutorials for Elixir Add Elixir tutorials Dec 11, 2016
1. Update code blocks to use Elixir instead of Erlang
2. Add bullet-pointed list when describing the REPL
3. Fix code type `Integers` -> `Integer`
4. Reword section on modules
5. Small typo fixes
@KimberleyCook
Copy link
Contributor

I'm going to close this PR as it's very old, I'd still very much be interested in an Elixir tutorial for our blog though in our tech section https://medium.com/the-codelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants