Slide 1

Slide 1 text

or bittersweet lessons learned from the Ruby ecosystem “We like to hate PHP” Ievgen Kuzminov. MobiDev. Kharkiv, Ukraine.

Slide 2

Slide 2 text

PHP is bad/slow/wrong/ugly… ? http://phpsadness.com/ Unexpected T_PAAMAYIM_NEKUDOTAYIM (╯°□°)╯︵ ┻━┻

Slide 3

Slide 3 text

Ruby is not better It is just a different mindset

Slide 4

Slide 4 text

Ievgen Kuzminov http://stdout.in @iJackUA 6 years in PHP 2 years in Ruby Currently: Ruby Team Lead in MobiDev Author of http://rwdtow.stdout.in

Slide 5

Slide 5 text

How to start a rant? http://stdout.in/en/post/ruby-ecosystem-bitte rsweet-or-we-like-to-hate-php

Slide 6

Slide 6 text

Healthy ecosystem: ▣ Frameworks pluralism ▣ Libraries agnosticism ▣ Tools, that just work

Slide 7

Slide 7 text

Recent decade of The Web Dev

Slide 8

Slide 8 text

‘’ Vicious circle of demand

Slide 9

Slide 9 text

1) Symfony 2) Laravel 3) Yii 4) Slim ... How many framework are in production? 1) Ruby on Rails ¯\_(ツ)_/¯

Slide 10

Slide 10 text

Frameworks are cheating! ▣ Do not teach to write better code ▣ Teach to use the framework only ▣ “In which folder should I put this class?”

Slide 11

Slide 11 text

What is it ? (Uncle Bob)

Slide 12

Slide 12 text

▣ Framework ▣ CMS ▣ Library Have you ever written your OWN...

Slide 13

Slide 13 text

▣ Learn the other language to get better view on your “native” one ▣ Traits/mixins are not “composition” ▣ Now I consider OOP as an “issue” I thought I knew OOP

Slide 14

Slide 14 text

▣ Not an end in itself, but the criterion ▣ Harder to follow with dynamic composition ▣ Dependency Injection. WAT ? SOLID

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

...or they don't have a chance because people can't look further the Rails monster. (C)

Slide 17

Slide 17 text

Evolution and Performance

Slide 18

Slide 18 text

PHP FIG Community and Standards

Slide 19

Slide 19 text

▣ Composer ▣ The League of Extraordinary Packages ▣ Aura for PHP Packages ▣ Bundler / Gems ▣ Dry-Web

Slide 20

Slide 20 text

Monkey-patching What is it? Example: 5.minutes.ago vs TimeMath.minutes.decrease(Time.now, 5)

Slide 21

Slide 21 text

Ruby or Rails? Array ▣ first ▣ second ▣ last ▣ second_to_last ▣ third_to_last ▣ forty_two

Slide 22

Slide 22 text

Syntax, DSL, metaprogramming Ruby has less parenthesis and formatting issues. Can handle DSL and metaprogramming. PHP has less possibilities… and that’s fine! Who cares when your IDE has autocomplete.

Slide 23

Slide 23 text

▣ PSR-4 rules! Modules and Namespaces ▣ Constants autoload hell

Slide 24

Slide 24 text

▣ Zend Expressive ▣ Slim ▣ Laravel ▣ ... Middlewares

Slide 25

Slide 25 text

Architecture inspiration Sandi Metz Nick Sutterer

Slide 26

Slide 26 text

The Clean Architecture by Uncle Bob

Slide 27

Slide 27 text

Trailblazer

Slide 28

Slide 28 text

Business logic architecture in PHP ▣ MVC is not enough ▣ Dependency Injection is not a silver bullet ▣ DCI ▣ CQRS (https://github.com/qandidate-labs/broadway) ▣ ?

Slide 29

Slide 29 text

Learn SQL. I mean it! ORM vs SQL

Slide 30

Slide 30 text

Where Ruby outperforms PHP Background jobs and queues

Slide 31

Slide 31 text

Where PHP outperforms Ruby Code debug

Slide 32

Slide 32 text

▣ PHPUnit ▣ Codeception ▣ Just recently became “a must” ▣ Who write tests? Automated testing ▣ Minitest / RSpec ▣ Capybara ▣ Propagated by Rails ▣ “TDD is dead” © DHH

Slide 33

Slide 33 text

Ideal PHP world for me ▣ Simple and reliable frameworks ▣ Agnostic middlewares ▣ Architectural framework ▣ Loosely-coupled tools/libs

Slide 34

Slide 34 text

“Haters gonna hate” (C) Break bad! Change the paradigm! Elixir, Go, Closure…

Slide 35

Slide 35 text

Thank you! [email protected] http://stdout.in @iJackUA Questions ?