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

What I Learned to Love About Ruby When I Switch...

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

What I Learned to Love About Ruby When I Switched To Python

June 24, 2017: GORUCO 2017

Avatar for redyaffle

redyaffle

June 24, 2017
Tweet

Other Decks in Technology

Transcript

  1. What I Learned to Love About Ruby When I Switched

    to Python Lauren Ellsworth June 24, 2017 GORUCO!
  2. “Each [language] contains a way of perceiving, categorizing, and making

    meaning in the world…” How Language Shapes Thought by Lera Boroditsky
  3. “Ruby should behave how you’d expect it to. This is

    easily described with a contrast to Python: $ irb irb(main):001:0> exit $ irb irb(main):001:0> quit $ python >>> exit Use exit() or Ctrl-D (i.e. EOF) to exit The Rails Doctrine, by David Heinemeier Hansson
  4. “The principle of least surprise is not for you only.

    The principle of least surprise means principle of least my surprise. And it means the principle of least surprise after you learn Ruby very well.” A Conversation with Yukihiro Matsumoto, Part I
  5. The Rails Doctrine, by David Heinemeier Hansson “Matz jumped implementational

    hurdles of astounding complexity to make the machine appear to smile at and flatter its human co-conspirator.”
  6. 2008 2020 July 2010: Python 2.7.0 Dec 2016: Python 2.7.13

    Dec 2008: Python 3.0.0 Mar 2017: Python 3.6.1 Apr 2020: Python 2 EOL Mar 2017: Ruby 2.3.4 Dec 2014: Ruby 2.2.0 Feb 2013: Ruby 2.0.0 Apr 2017: Ruby 2.2.0 Enters security support
  7. py

  8. • Version Management aka lots of rubies, and all of

    their dependencies living happily side by side
  9. $ history 1 ruby -v # 2.3.1p112 2 sqlite3 --version

    # 3.16.0 3 rails --version # Rails 5.1.1 4 rails new blog 5 cd blog/ 6 bin/rails server 7 rails generate controller Welcome index 8 vim . # Hello, Rails! editing 9 rails generate controller Articles 10 vim . # New articles_controller methods 11 rake routes # Inspect routes 12 rails generate model Article title:string text:text 13 rails db:migrate 14 bin/rails server # Restart rails server
  10. $ history 1 python --version # 3.6.1 2 sqlite3 --version

    # 3.16.0 3 python -m Django --version # 1.11.2 4 django-admin startproject mygorucosite 5 cd mygorucosite/ 6 python manage.py runserver
  11. $ history 1 python --version # 3.6.1 2 sqlite3 --version

    # 3.16.0 3 python -m Django --version # 1.11.2 4 django-admin startproject mygorucosite 5 cd mygorucosite/ 6 python manage.py runserver 7 vim . # Edit ALLOWED_HOSTS 8 python manage.py startapp polls 9 python manage.py makemigrations polls 10 python manage.py sqlmigrate polls 0001 11 python manage.py migrate 12 python manage.py createsuperuser 13 vim . # Edit polls/view, mysite/urls.py, polls/urls.py, settings.py 14 python manage.py runserver
  12. environment information ✔ basic instructions ✔ timestamped lines ✔ web

    requests ✔ ✔ web parameters ✔ render timing ✔ database interactions ✔ database parameters ✔ database timing ✔ controllers / methods used ✔ server reloads ✔
  13. “consider that every policy must have a no-action default” Do

    Defaults Save Lives? Eric J. Johnson and Daniel Goldstein
  14. Lost in Translation by Lera Boroditsky “Patterns in language offer

    a window on a culture’s dispositions and priorities.”
  15. MINASWAN Matz is nice and so we are nice BDFL

    Benevolent Dictator for Life
  16. MINASWAR Matz is nice and so we are nice and

    so we are respectful BDFL Benevolent Dictator for Life