$30 off During Our Annual Pro Sale. View Details »

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
Tweet

More Decks by Stephen McCullough

Other Decks in Programming

Transcript

  1. Python… Ruby…
    Now Elixir?
    Hipsters Assemble

    View Slide

  2. 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

    View Slide

  3. Hipsters Assemble…
    Is this harsh?

    View Slide

  4. So why Elixir?
    • The future is functional
    • The future is concurrent

    View Slide

  5. 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

    View Slide

  6. Concurrency
    • Its here to stay
    • Concurrency in Elixir is easy.

    View Slide

  7. 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

    View Slide

  8. So why Elixir again?
    • In my head it isn’t that big a step from python/
    ruby to elixir
    • Community is great

    View Slide

  9. hello.erl
    • ruby like syntax
    • I’ve found that elixir takes a lot
    of things from ruby

    View Slide

  10. hello.erl
    • In Elixir 'def' is a function call
    • In Elixir ‘if’ is a function call too

    View Slide

  11. Meta Programming!
    • Elixir embraces metaprogramming
    • To me this was scary and not at all native to my
    thinking.
    • Elixir is Macros, mostly

    View Slide

  12. Elixir is Macros
    • …. mostly
    • Elixir uses macros to provide interfaces for
    expanding complex sets of instructions during
    compilation

    View Slide

  13. 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

    View Slide

  14. 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.

    View Slide

  15. 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.

    View Slide

  16. 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

    View Slide

  17. What I want to learn next
    • Protocols
    • Sigils
    • Recursion

    View Slide

  18. View Slide