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