refactoring ruby without ruby - sergey pchelincev

22
REFACTOR RUBY WITHOUT RUBY SERGEY PCHELINTSEV

Upload: ruby-meditation

Post on 07-Jan-2017

129 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Refactoring Ruby without Ruby - Sergey Pchelincev

REFACTOR RUBY WITHOUT RUBY

SERGEY PCHELINTSEV

Page 2: Refactoring Ruby without Ruby - Sergey Pchelincev

QUICK INTRO

JALKOBY -> GITHUB || TWITTER

E-MAIL -> [email protected]

BEER -> HTTPS://TELEGRAM.ME/BEERJSKYIV

Page 3: Refactoring Ruby without Ruby - Sergey Pchelincev

LET’S STICK WITH THE TERMS

REFACTORING IS THE PROCESS OF RESTRUCTURING EXISTING COMPUTER CODE WITHOUT CHANGING ITS EXTERNAL BEHAVIOUR

EXTERNAL BEHAVIOUR IS THE BEHAVIOUR OF AN ENTITY AS SEEN AT ITS INTERFACE, WITHOUT SEEING INSIDE THE ENTITY OR ITS OTHER INTERFACES

Page 4: Refactoring Ruby without Ruby - Sergey Pchelincev

WHAT’S MAKE ME PROUD

REFACTORING IS A CORE PART OF

THE RUBY IDEOLOGY

Page 5: Refactoring Ruby without Ruby - Sergey Pchelincev

WHAT’S MAKE ME SAD

FOR THE PAST THREE YEARS THERE WAS ANY NEW THING

▸ the tools ecosystem has been slowdown

▸ speakers talks about the same things over & over

▸ the language doesn’t bring anything awesome

(get ready for the built-in pry on 25.12.2016 🎉😒😒😒)

Page 6: Refactoring Ruby without Ruby - Sergey Pchelincev

RUBY IN A COMA

John Doe

LONG STORY SHORT

Page 7: Refactoring Ruby without Ruby - Sergey Pchelincev

HOLD ON, DON’T BE ANGRY

COMA IS NOT THE ENDAFTER ALL THIS LEMON CAN GIVE US A MONEY FOR A FEW YEARS

Page 8: Refactoring Ruby without Ruby - Sergey Pchelincev

JUST DON’T PUT ALL YOUR EFFORT ON IT. OTHERWISE…

Page 9: Refactoring Ruby without Ruby - Sergey Pchelincev

WHEN YOU ACCEPT THIS, ONE THING WILL HAPPEN*

YOU WILL USE THE LANGUAGE LESS OFTEN…

Page 10: Refactoring Ruby without Ruby - Sergey Pchelincev

WHEN YOU ACCEPT THIS, ONE THING WILL HAPPEN*

… BUT MUCH MORE EFFECTIVELY

*THE EFFECT DOES NOT REPRODUCES ON SHIT CODERS

Page 11: Refactoring Ruby without Ruby - Sergey Pchelincev

YOU START DISCOVER ONE INTERESTING SIDE-EFFECT

YOUR RUBY CODE REFACTORS WITHOUT RUBY

Page 12: Refactoring Ruby without Ruby - Sergey Pchelincev

PHASE 0

YOU START NOTICING THAT FRONTEND IS NOT A TOY

NOWADAYS

Page 13: Refactoring Ruby without Ruby - Sergey Pchelincev

PHASE 1 - CSS

Page 14: Refactoring Ruby without Ruby - Sergey Pchelincev

PHASE 1 - CSS

Page 15: Refactoring Ruby without Ruby - Sergey Pchelincev

FIRST THEY IGNORE YOU, THEN THEY LAUGH AT YOU, THEN THEY FIGHT YOU, THEN YOU WIN.

Mahatma Gandhi (a senior js developer)

PHASE 2 - JS

Page 16: Refactoring Ruby without Ruby - Sergey Pchelincev

PHASE 2 - JS

IT WAS A RADICAL CHANGE IN A PAST FEW YEARS

2010 NOWADAYS

Page 17: Refactoring Ruby without Ruby - Sergey Pchelincev

PHASE 2 - JS

IT STEALS:

▸ Views

▸ Presenters

▸ Helpers

▸ Controllers

▸ Routing

▸ Translation and localization

Page 18: Refactoring Ruby without Ruby - Sergey Pchelincev

PHASE 2 - JS

ALL YOUR VIEWS IS:

Page 19: Refactoring Ruby without Ruby - Sergey Pchelincev

PHASE 2 - JS

RUBY IS JUST A THIN LAYER OF AUTHENTICATION + PERSISTENCE

Page 20: Refactoring Ruby without Ruby - Sergey Pchelincev

PHASE 3 - AUTHENTICATION & PERSISTENCE

DATABASES ARE NOT MYSQL ANYMORE

▸ JSON is a part of any adequate database

▸ Row Level Security - your database itself manages an

authorisation logic

▸ Database validation functions

Page 21: Refactoring Ruby without Ruby - Sergey Pchelincev

TO SUM UP

EVEN IF RUBY IS STACK IN 2012, THE OUTSIDE WORLD CAN MAKE IT BETTER

Page 22: Refactoring Ruby without Ruby - Sergey Pchelincev

FOR THE LAST WORD

THANK YOU