SlideShare a Scribd company logo
.
DEL 1
TOBBE
@tobbeanderberg
OLA
@ellnestam
REFAKTORISE
RA
FRAMTID
A
FÖ
R
DIT
T
JA
G
REFAKTORISERA FÖR DITT FRAMTIDA
JAG
GÖR KODEN
LÄTTLÄST
MINSKA KOGNITIV
LAST
SEX NYCKELREFAKTORISERINGAR
RENAM
E
EXTRACT METHOD
INTRODUCE
FIELD
INTRODUCE
LOCAL VARIABLE
INLINE
INTRODUCE
PARAMETER
ADD COMMENT
ADD COMMENT
LÄSBARHET ÄR NYCKELN
GÖR KOD SKUMBAR
INSIKTSLOOPEN
INSIKTSLOOPEN
● TITTA PÅ KOD
INSIKTSLOOPEN
● TITTA PÅ KOD
● FÅ EN INSIKT
INSIKTSLOOPEN
● TITTA PÅ KOD
● FÅ EN INSIKT
● ÄNDRA KOD
INSIKTSLOOPEN
● TITTA PÅ KOD
● FÅ EN INSIKT
● ÄNDRA KOD
● CHECKA IN
INSIKTSLOOPEN
DEL 2
NAMNGIVNINGENS
7 STEG
FULLSTÄNDIGNONSENSSAKNAS ÄRLIG GÖR RÄTT SAK AVSIKT
DOMÄN-
ABSTRAKTION
STEG LETA EFTER INSIKT VAD GÖR VI
STEG LETA EFTER INSIKT VAD GÖR VI
inget nonsens→ Långa saker Är en klump Namnge klumpen
STEG LETA EFTER INSIKT VAD GÖR VI
nonsens ärlig→ Leta mönster Koden gör X Ärligt namn
STEG LETA EFTER INSIKT VAD GÖR VI
ärlig fullständig→ En effekt Mer specifika saker
som görs
Lägg till ett villkor
STEG LETA EFTER INSIKT VAD GÖR VI
fullständig gör→
rätt sak
I namnet En sak som inte ska
exponeras
Extrahera och
kapsla in delar
STEG LETA EFTER INSIKT VAD GÖR VI
gör rätt sak →
avsikt
Anropande metoder Varför
finns/används
koden
Ett nytt namn som
signalerar avsikt
STEG LETA EFTER INSIKT VAD GÖR VI
avsikt domän-→
abstraktion
Saker som
påminner om
varandra
Detta är en/ett X Ny typ/klass
STEG LETA EFTER INSIKT VAD GÖR VI
inget nonsens→ Långa saker Är en klump Namnge klumpen
nonsens ärlig→ Leta mönster Koden gör X Ärligt namn
ärlig fullständig→ En effekt Mer specifika saker
som görs
Lägg till ett villkor
fullständig gör→
rätt sak
I namnet En sak som inte ska
exponeras
Extrahera och
kapsla in delar
gör rätt sak →
avsikt
Anropande metoder Varför
finns/används
koden
Ett nytt namn som
signalerar avsikt
avsikt domän-→
abstraktion
Saker som
påminner om
varandra
Detta är en/ett X Ny typ/klass
DEL 3
“Ohm wi inte hade behövfa endrat
kod så hade allt hfvarit fridens och
”fröjdens
, -Okänd programmerare 1350 talet
FULLSTÄNDIGNONSENSSAKNAS ÄRLIG GÖR RÄTT SAK AVSIKT
DOMÄN-
ABSTRAKTION
HÄR BÖRJAR
STRUKTURELL
REFAKTORISERING ...
GÖR RÄTT SAK AVSIKT
DOMÄN-
ABSTRAKTION
Money används i
stället för BigDecimal
Money används i
stället för BigDecimal
● SÄTT UPP ETT MÅL
● EXPERIMENTERA
● VISUALISERA
● ÅNGRA
Money används i
stället för BigDecimal
Alla ränteberäkningar
använder Money
Alla bud till
Låneförmedlare
serialiseras med rätt
serialiserare
Förmedlare X Förmedlare ZFörmedlare Y
TEKNISK MARKNAD
FÖRELAGD
ÅDRAGEN
TEKNISK MARKNAD
FÖRELAGD
ÅDRAGEN
“OM DOM HÖJER
PRISET PÅ API-ANROPEN
ÄR VI KÖRDA”
“VI HAR INGET VAL
GDPR GÄLLER FRÅN
FÖRSTA MAJ!”
“KOPIERA?! DET MÅSTE FUNKA
I OFFLINE-LÄGE OCKSÅ”
“ALLA SERVRAR SKA
UPP TILL JAVA 10”
TEKNISK MARKNAD
FÖRELAGD
ÅDRAGEN
ANTIKORRUPTIONSLAGER ANALYSERA MARKNADEN
SYNKA OFTA MED PRODUKTÄGARENEN SAK I TAGET
...
OCH
SIMM
A
LUGN
T
TAC
K

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
 

Featured (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Refaktorisera för ditt framtida jag