pass it on

No images? Click here

Video recording got done yesterday finally. It is in the editor's hands now and should go out in about two weeks. Time to line up the next one.

 

Recent publishing

Building healthy Elixir teams

Meryl Dakin was nice enough to come on the show and talk about her experiences across multiple Elixir teams.

You may find that she was such a treat we kept her around :)

Link: Episode 46, BEAM Radio

Live

A livestream today where I work on a project for the Electric SQL folks. The archive will be up on the channel after.

Current offerings

If you are interested in spinning up a product team in Elixir. Reach out. Either my team or some people I know can really get you started at a sprint.

 

Just programming fundamentals

If you know Elixir, I'd love your thoughts on this subset of functionality for teaching it.

If you don't know Elixir, I'd love your reaction to this outline.

I've been mulling over what I'd do to try and teach Elixir without covering every corner of the language. What's the important pieces. What Erlang concepts should I need to cover? This is my stab at it.

Bare values
Booleans, numbers and strings. These are fundamentals that I think are needed to make any learnable example.

Calculations and creating new values
Basic math operators and potentially something from the Math module (without explaining modules or functions). Then String concatenation, some stuff from the String module. And then likely some of the Integer module.

Bindings, naming values
Explain assigning names to values by binding them to identifiers. Show some examples. Including rebinding.

Sidetrack:  Basic output, IO.inspect
To enable us to look at more values as we work on them I think we need to cover this function.

Case statements and pattern matching values
The only conditional I plan on covering. Everything else can essentially be done with a case so covering the if macro, cond and with will just muddy the waters and make things complicated. That can be a later thing if we must. The pattern matching would be limited to full literal values here and probably a catch-all binding.

Functions, anonymous
Starting with anonymous functions. We can limit ourselves to the `fn x -> :ok end` syntax to keep things clear. Defining them, binding them and calling them.

Modules and named functions
We only need to cover public functions at this point. Private functions are a nicety.

More values
Atoms, an unchangeable identifier, a label, no calculations to be made, cannot be modified.
Composite values:

  • Tuple, grouping multiple values, specific number, few
  • List, collect multiple values, any number, ordered
  • Map, values pointing to values

Pattern matching composite values
This is where cover unpacking a tuple, plucking the head from a list and plucking a key from a map. This is where some more explanation and examples of case statements need to happen. A good moment to also introduce multiple function heads with matches. I think that pattern is so common and useful it needs to be in there.

Manipulating collections, the Enum module
Mapping, same shape, simpler to use.
Reduce, filtering, sorting, changing the shape. More complex.

Manipulating collections, the Map module
Adding and removing items. Mostly.

Files
Reading from and writing to files. Partial reads and partial writes with the IO module. This gives some fundamental understandings of files and IO.

Simultaneous activity
Processes, using Kernel.spawn.
Messages, using Kernel.send and receive.
Tasks, nicer to work with. async + await.
Even nicer. Task.async_stream.

This could all be done in the space of a Livebook or by writing an Elixir .exs script. Beyond here lies the first Mix project and more advanced topics. At this point I think someone could be far more dangerous with Elixir than I was with C++ the first time I tried programming.

Did I miss anything? Does it make sense to you? If so, share it with someone you think should learn Elixir. Maybe they'll follow it? Should I build a small thing for learning it this way? 

Would love to hear what you think at lars@underjord.io or as @lawik@fosstodon.org.

Thank you for reading. I appreciate you spending your attention here.

 
 

This is an email from Underjord, a swedish consultancy run by Lars Wikman.

Everything else is found at underjord.io

You signed up for this newsletter and confirmed the subscription. If you want to stop receiving it. Just use the link below.

Preferences  |  Unsubscribe