Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python.. Ruby.. Now Elixir? - Hipsters Assemble

Python.. Ruby.. Now Elixir? - Hipsters Assemble

The thoughts of a bad programmer on moving from a ruby and python background to Elixir

Presented to the KatsConf conference on the 16th September 2016

Stephen McCullough

September 17, 2016

More Decks by Stephen McCullough

Other Decks in Programming


  1. About Me • Stephen McCullough • Currently working at ShopKeep

    as Senior Software Engineer • On a daily basis I use python & ruby • Find me at swm.cc or @swmcc on various interwebs
  2. Immutability and functional • Elixir is a functional language with

    immutability • Mutability brings an uncertainty about how a program will execute • Functional programming and immutability makes it easier to reason about code
  3. Web Framework • Phoenix is the most popular web framework

    (for now) • Creator of Elixir is a Rails core member and the creator of Phoenix • Opens up possibilities that are not present in traditional web frameworks
  4. So why Elixir again? • In my head it isn’t

    that big a step from python/ ruby to elixir • Community is great
  5. hello.erl • In Elixir 'def' is a function call •

    In Elixir ‘if’ is a function call too
  6. Meta Programming! • Elixir embraces metaprogramming • To me this

    was scary and not at all native to my thinking. • Elixir is Macros, mostly
  7. Elixir is Macros • …. mostly • Elixir uses macros

    to provide interfaces for expanding complex sets of instructions during compilation
  8. Pattern Matching • In Elixir, the = sign doesn’t necessarily

    mean “set this variable equal to something else” • The realisation that it behaves differently based on the types involved
  9. List Comprehensions • I <3 list comprehensions. Ruby doesn’t have

    them but python does. • I have found that Elixir often has better functions (such as those from List and Enum) which are more flexible.
  10. Higher-Order Functions • Passing functions as arguments - it can

    be done in ruby and python. • Native and natural part of the language rather than an oddity.
  11. I’m at the start • I am slowly learning Elixir

    • I have found it “exciting” • It takes a while to get into the headspace • Functional yet practical