THE GREENER GRASS
Stefan Wintermeyer - @wintermeyer
Slide 2
Slide 2 text
Ruby or Elixir?
Spoiler alert:
It’s not a technical decision.
The 5 most active programming languages on GitHub:
JavaScript, Python, Java, Rust, PHP
Slide 3
Slide 3 text
http://www.website.com
My First Commercial Webpage (1997)
https://web.archive.org/web/19970413021718/http://www.swreisedienst.de/
Slide 4
Slide 4 text
http://www.website.com
My First Online Shop (1997)
http://www.website.com
https://web.archive.org/web/19970413021718/http://www.swreisedienst.de/
https://web.archive.org/web/19970413021718/http://www.swreisedienst.de/
Slide 5
Slide 5 text
My First Online Shop was written in Delphi (1997)
http://www.website.com
https://web.archive.org/web/19970413021718/http://www.swreisedienst.de/
Slide 6
Slide 6 text
Programming Languages I’ve Used For Online Shops Since
Language Server OS Development OS Framework
Delphi Win 3.11 Win 3.11 -
Perl Linux Linux -
PHP Linux Linux and macOS -
Ruby Linux macOS Ruby on Rails
Elixir Linux macOS Phoenix Framework
Ruby was published in
1995 by Yukihiro
Matsumoto for
developer’s happiness.
Slide 10
Slide 10 text
Elixir was created in
2011 by José Valim to
be a real concurrent
language.
Slide 11
Slide 11 text
Titlelize Code Example
"ExMachina Hits 1.0 - More Flexible, More Useful and Support for Ecto 2.0"
=> "exmachina-hits-1-0-more-flexible-more-useful-and-support-for-ecto-2-0!
Ruby Elixir
https://thoughtbot.com/blog/elixir-for-rubyists
Slide 12
Slide 12 text
Don’t let the easy to read
Elixir syntax fool you into
believing it’s painless to learn.
Functional is a totally
different ball game!
Slide 13
Slide 13 text
Regular Switching
Between Elixir And Ruby
Back And Forth Results In
Technical Jet Lag.
Slide 14
Slide 14 text
We all know about Ruby.
But what do people do with Elixir?
Slide 15
Slide 15 text
Nerves Is An Astonishing Elixir Project
Craft and deploy bulletproof embedded software in Elixir.
• Raspberry Pi
• BeagleBone
• Generic x86_64
https://www.nerves-project.org
Slide 16
Slide 16 text
Nerves Example: FarmBot https://farm.bot
Slide 17
Slide 17 text
vs
But 99% Of The Discussion is Rails vs. Phoenix
Slide 18
Slide 18 text
Fun fact: All players have a solid Ruby on Rails background.
@josevalim @dhh @chris_mccord
Slide 19
Slide 19 text
Ruby on Rails Doctrine
"Optimize for programmer happiness"
Me thinking: But I have been very unhappy with
some gems and very happy with Phoenix.
https://rubyonrails.org/doctrine/
Slide 20
Slide 20 text
Phoenix Framework
"Build rich, interactive web applications quickly, with
less code and fewer moving parts"
Me thinking: But I have done rich interactive web applications with Rails too.
https://www.phoenixframework.org
Slide 21
Slide 21 text
How does the 15 Minute Blog example hold on in 2020?
DHH’s 2005 grandfather screencast: https://www.youtube.com/watch?v=Gzj723LkRJY
Slide 22
Slide 22 text
Ruby on Rails
@dhh
Slide 23
Slide 23 text
$ rails new my_blog
$ cd my_blog
$ rails g scaffold post title body:text
$ rails db:migrate
$ rails server
# Open http://0.0.0.0:3000/posts
Fun fact:
$ my_blog:> tree | wc -l
19572
Slide 24
Slide 24 text
No content
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
Phoenix Framework
@chris_mccord
Slide 27
Slide 27 text
$ mix phx.new my_blog
$ cd my_blog
# configure database in config/dev.exs (no SQLite )
$ mix ecto.create
$ mix phx.gen.html Blog Post posts title body:text
# add "resources "/posts", PostController" to router.ex
$ mix ecto.migrate
$ mix phx.server
# Open http://0.0.0.0:4000/posts
Phoenix USPs
Performance/Speed Scalability
High-Availability Systems
Hot Deployment
Slide 35
Slide 35 text
"… Phoenix has delivered
15x better performance
than Rails …"
https://medium.com/@elviovicosa/phoenix-vs-rails-benchmark-2019-f0e68336d557
Slide 36
Slide 36 text
What should I use?
Slide 37
Slide 37 text
Use Elixir/Phoenix if performance is paramount.
Technically it is the best choice!
Slide 38
Slide 38 text
Use Elixir/Phoenix if your
team doesn’t have (much) Ruby knowledge yet.
Technically it is the best choice!
Slide 39
Slide 39 text
Use Ruby/Rails for all other cases.
Slide 40
Slide 40 text
A bad programmer can write a slow program in Assembler.
A good programmer can write a fast program in Visual Basic.
Jon von Tetzchner told me that some 20 years ago.
Slide 41
Slide 41 text
Do or do not.
There is no try.
Stefan Wintermeyer
[email protected]
@wintermeyer