SlideShare a Scribd company logo
CLEAN(ER) CODE
TECH ’N‘ DRINKS
ABOUT ME
MARTIN “D4RK” STRAUB
▸ iOS developer @myposter !
▸ Guitar player @kentuckyschreit (ska/pop-punk) 🎸
▸ Husband 💑
▸ Cat 😺
Clean(er) Code - Tech'n'Drinks @myposter
Clean(er) Code - Tech'n'Drinks @myposter
Clean(er) Code - Tech'n'Drinks @myposter
Clean(er) Code - Tech'n'Drinks @myposter
ABOUT ME
MARTIN “D4RK” STRAUB
▸ ...
▸ ...
▸ martin-straub.de
▸ iOS developer @myposter !
▸ Guitar player @kentuckyschreit (ska/pop-punk) 🎸
▸ Husband 💑
▸ Cat 😺
DRY
DON’T REPEAT YOURSELF
EVERY PIECE OF KNOWLEDGE MUST HAVE
A SINGLE, UNAMBIGUOUS, AUTHORITATIVE
REPRESENTATION WITHIN A SYSTEM.
The Pragmatic Programmer
DON’T REPEAT YOURSELF (DRY)
DON’T REPEAT YOURSELF (DRY)
WHAT’S IT ABOUT?
▸ Don’t repeat the knowledge
▸ Avoid contradictions
▸ One source of truth
DON’T REPEAT YOURSELF (DRY)
TYPES OF DUPLICATION
▸ Imposed duplication
▸ Inadvertent duplication
▸ Impatient duplication
▸ Interdeveloper duplication
DUPLICATION IS FAR
CHEAPER THAN THE
WRONG ABSTRACTION.
Sandi Metz
(Teacher, writer, consultant, programmer)
A SYSTEM’S KNOWLEDGE IS FAR
BROADER THAN JUST ITS CODE.
DON’T REPEAT YOURSELF (DRY)
The Pragmatic Programmer
DON’T REPEAT YOURSELF (DRY)
BROADER USAGE
▸ Database schemas
▸ Test plans
▸ Build system
▸ Documentation
KISS
KEEP IT SIMPLE, STUPID
KEEP IT SIMPLE STUPID
Kelly Johnson
(Lead engineer at Lookheed Martin)
KEEP IT SIMPLE, STUPID (KISS)
WHAT’S IT ABOUT?
▸ Most systems work best if they are kept simple
rather than made complicated
▸ Simplicity should be a key goal in design
▸ Unnecessary complexity should be avoided
▸ The end-user doesn’t care how smart you are
▸ If you have to explain the product, it’s too
complicated
MAKE EVERYTHING AS SIMPLE AS
POSSIBLE, BUT NOT SIMPLER
Albert Einstein
KEEP IT SIMPLE, STUPID (KISS)
YAGNI
YOU AIN’T GONNA NEED IT
YOU AIN’T GONNA NEED IT (YAGNI)
WHAT’S IT ABOUT?
▸ 80% of the time spent on a software project is
invested in 20% of the functionality
▸ Prioritize (MoSCoW)
▸ No future coding
▸ No overengineering
MUST HAVE
SHOULD HAVE
COULD HAVE
WON’T HAVE (THIS TIME)
MoSCoW principle
DRY VS. KISS & YAGNI
SUMMARY
▸ DRY strives for abstraction
▸ KISS aims for simplicity
▸ YAGNI doesn’t want to do it at all
▸ Those principles compete with each other
▸ Find the right balance between DRY and KISS/
YAGNI
RCA
ROOT CAUSE ANALYSIS
…USE A BUCKET!
WATER DRIPS FROM THE
CEILING?
…RIGHT?! 🧐
SOLVE PROBLEMS
THERE ARE 2 WAYS TO
ROOT CAUSE ANALYSIS (RCA)
1. REACTIVE MANAGEMENT
▸ React quickly, by treating the symptoms
▸ Goal: Ease the effects of the problem as soon
as possible
Clean(er) Code - Tech'n'Drinks @myposter
Clean(er) Code - Tech'n'Drinks @myposter
Clean(er) Code - Tech'n'Drinks @myposter
ROOT CAUSE ANALYSIS (RCA)
2. PROACTIVE MANAGEMENT
▸ Address the real cause instead of its symptoms
▸ Goal: Prevent problems from (re-)occurring
ROOT CAUSE ANALYSIS (RCA)
ROOT CAUSE ANALYSIS
▸ Identification and description
▸ Chronology
▸ Differentiation
▸ Causal graphing
▸ Next step: Trigger long-term corrective actions
BY REPEATING WHY FIVE TIMES, THE
NATURE OF THE PROBLEM AS WELL AS
ITS SOLUTION BECOMES CLEAR.
Taiichi Ohno
ROOT CAUSE ANALYSIS (RCA)
(“Father” of the Toyota Production System)
ROOT CAUSE ANALYSIS (RCA)
5 WHYS
Example: Ran through a red light. (problem)
▸ Why? - Late for work. (1st why)
▸ Why? - Woke up late. (2nd why)
▸ Why? - Alarm clock didn’t ring. (3rd why)
▸ Why? - Battery was empty. (4th why)
▸ Why? - Forgot to charge it. (5th why and root
cause)
ROOT CAUSE ANALYSIS (RCA)
CONCLUSION
▸ Reactive management: quickly ease the
symptoms
▸ Proactive management: actually fix the issue
▸ Only the latter can lead to a sustainable and
reliable code base
WANT SOME MORE?!
MAKE IT WORK,
MAKE IT RIGHT,
MAKE IT FAST.
Kent Beck
(Software engineer, creator of extreme programming, TDD, …)
IT’S HARDER TO READ
CODE THAN TO WRITE IT.
Joel Spolsky
(Co-founder of Stack Overflow)
BUILD YOUR LOGIC ON
DIRECT RELATIONS, NOT
ON ASSUMPTIONS.
Unknown author
LOGIC DEPENDENCIES
EXAMPLES
▸ App: Does the UI depend on the device’s
orientation?

... or on parent view changes?
▸ Do you grab yourself a new beer every 15
minutes?

… or every time the bottle’s empty?
SUMMARY
CLEAN(ER) CODE
CLEAN(ER) CODE
SUMMARY
▸ Play the principle game
▸ BUT:
▸ Principles are not rules
▸ Find the right balance
▸ Always use common sense
▸ Don’t get paralysed by overthinking things
SOURCES
CLEAN(ER) CODE
SOURCES
TITLE & ABOUT ME
▸ https://twitter.com/ColucciLaw/status/1010920761043939328
▸ martin-straub.de
▸ https://www.instagram.com/maezikatzi
SOURCES
DON’T REPEAT YOURSELF (DRY)
▸ https://pragprog.com/book/tpp/the-pragmatic-programmer
▸ https://thevaluable.dev/dry-principle-explained
▸ http://verraes.net/2014/08/dry-is-about-knowledge
▸ https://www.sandimetz.com/blog/2016/1/20/the-wrong-abstraction
SOURCES
DRY (IMAGES)
▸ https://www.flickr.com/photos/liveoncelivewild/32686776783
▸ https://medium.com/startup-grind/even-smart-vcs-invest-in-cross-industry-
clones-6a3c63f830e4
▸ https://www.engadget.com/2016/07/27/dolly-sheep-clones-are-healthy
▸ https://www.writermag.com/writing-inspiration/the-writing-life/declutter-
hoarded-story-ideas
SOURCES
KEEP IT SIMPLE, STUPID (KISS)
▸ https://en.wikipedia.org/wiki/Kelly_Johnson_(engineer)
▸ https://www.interaction-design.org/literature/article/kiss-keep-it-simple-stupid-
a-design-principle
▸ https://championingscience.com/2019/03/15/everything-should-be-made-as-
simple-as-possible-but-no-simpler
SOURCES
KISS (IMAGES)
▸ https://archive.triblive.com/aande/music/kiss-makeup-has-changed-but-their-
impact-remains-strong
▸ https://mannerofspeaking.org/2018/03/11/simplicity-is-the-key-to-brilliance
▸ https://mostlyme-certainothers.com/2015/07/16/no-frills/simplicity-01
SOURCES
YOU AIN’T GONNA NEED IT (YAGNI)
▸ https://ronjeffries.com/articles/019-01ff/iter-yagni-skimp
▸ https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it
▸ https://en.wikipedia.org/wiki/MoSCoW_method
SOURCES
YAGNI (IMAGES)
▸ https://www.monkeyuser.com/2019/yagni
▸ https://www.developgoodhabits.com/80-20-rule
▸ http://www.thebluediamondgallery.com/wooden-tile/p/priority.html
▸ https://xkcd.com/974
SOURCES
ROOT CAUSE ANALYSIS (RCA)
▸ https://en.wikipedia.org/wiki/Root_cause_analysis
▸ https://en.wikipedia.org/wiki/5_Whys
▸ https://en.wikipedia.org/wiki/Taiichi_Ohno
▸ https://kanbanize.com/lean-management/improvement/5-whys-analysis-tool
SOURCES
RCA (IMAGES)
▸ https://twitter.com/moksony/status/809695818223681536
▸ https://www.sueddeutsche.de/muenchen/nahverkehr-darum-tropft-es-beim-s-
bahn-gleis-am-marienplatz-1.3330650
▸ https://www.br.de/nachrichten/bayern/s-bahn-chaos-in-muenchen-stoerung-
nach-wassereintritt-dauert-an,RYNZ6Kw
▸ https://twitter.com/sabbiafilms/status/912692514519502849
▸ https://www.monkeyuser.com/2018/final-patch
SOURCES
RCA (IMAGES) 2
▸ https://www.jaguarforums.com/forum/x-type-x400-14/multiple-codes-read-
puter-106645
▸ https://psychologyhumor.tumblr.com/post/165200208492/express-
psychotherapy
▸ https://michaelwtravels.boardingarea.com/2015/06/airline-fix-plane-duct-
tape-uses/travelnews-111
▸ https://www.solarwindsmsp.com/blog/results-show-controlnow-can-make-
department-proactive
SOURCES
RCA (IMAGES) 3
▸ https://www.monkeyuser.com/2018/root-cause
▸ https://medium.com/@m.azeem111/why-statement-c2a5b1f8b0fa
▸ https://brightpast.com/how-to-use-social-media-for-proactive-reputation-
management
SOURCES
MAKE IT WORK, MAKE IT RIGHT, MAKE IT FAST.
▸ https://www.thetombomb.com/2018/05/17/make-it-work-make-it-right-make-
it-fast
▸ http://engineerspro.blogspot.com/2016/06/career-information-regarding-
mechanical.html
▸ https://www.pixwords.solutions/tl/solution/pagliko
▸ https://www.donanimhaber.com/spacex-falcon-roketine-ait-parcanin-dunya-ya-
dustugu-anin-videosunu-yayinladi--115810
SOURCES
IT’S HARDER TO READ CODE THAN TO WRITE IT.
▸ https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-
part-i
SOURCES
BUILD YOUR LOGIC ON DIRECT RELATIONS, NOT ON ASSUMPTIONS.
▸ https://www2.le.ac.uk/institution/lias/images/Fellows%203.jpg/view
▸ https://medium.com/@CodementorIO/good-developers-vs-bad-developers-
fe9d2d6b582b
SOURCES
SUMMARY & SOURCES
▸ https://code.tutsplus.com/tutorials/3-key-software-principles-you-must-
understand--net-25161
▸ https://en.wikipedia.org/wiki/Analysis_paralysis
▸ https://www.mr-maid.com/blog/hiring-bad-cleaning-service
▸ https://www.acadoo.de/woran-erkenne-ich-serioese-quellen.html
▸ https://en.wikipedia.org/wiki/LOLCODE
KTHXBYE
CLEAN(ER) CODE

More Related Content

Similar to Clean(er) Code - Tech'n'Drinks @myposter

Making software
Making softwareMaking software
Making software
naeemullah530
 
Just the basics_strata_2013
Just the basics_strata_2013Just the basics_strata_2013
Just the basics_strata_2013
Ken Mwai
 
All I Really Need To Know About Pair Programming I Learned In Kindergarten
All I Really Need To Know About Pair Programming I Learned In KindergartenAll I Really Need To Know About Pair Programming I Learned In Kindergarten
All I Really Need To Know About Pair Programming I Learned In Kindergarten
Fred Lee
 
How to have good business ideas workshop
How to have good business ideas workshopHow to have good business ideas workshop
How to have good business ideas workshop
Gustavo Carriconde
 
Living documentation
Living documentationLiving documentation
Living documentation
Samuel ROZE
 
Modular vs Monolith
Modular vs MonolithModular vs Monolith
Modular vs Monolith
Timothy Oxley
 
Designing the User Experience
Designing the User ExperienceDesigning the User Experience
Designing the User Experience
Marc Escobosa
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
Ambrose Little
 
Good vs. Great Design
Good vs. Great DesignGood vs. Great Design
Good vs. Great Design
Cameron Moll
 
Game of Sprints
Game of SprintsGame of Sprints
Game of Sprints
Kevlin Henney
 
Advancing the web without breaking it - #btconf
Advancing the web without breaking it - #btconfAdvancing the web without breaking it - #btconf
Advancing the web without breaking it - #btconf
Christian Heilmann
 
Mind the Gap - State of the Browser 2015
Mind the Gap - State of the Browser 2015Mind the Gap - State of the Browser 2015
Mind the Gap - State of the Browser 2015
Christian Heilmann
 
More From Less -- Ivan Beram
More From Less -- Ivan BeramMore From Less -- Ivan Beram
More From Less -- Ivan Beram
Ivan Beram
 
[Keynote] James Higgs - Quality is a variable
[Keynote] James Higgs - Quality is a variable[Keynote] James Higgs - Quality is a variable
[Keynote] James Higgs - Quality is a variable
Codemotion
 
Quality is a variable
Quality is a variableQuality is a variable
Quality is a variable
ustwo
 
Diving into event-sourcing and event-driven architectures
Diving into event-sourcing and event-driven architecturesDiving into event-sourcing and event-driven architectures
Diving into event-sourcing and event-driven architectures
Unai Esteibar
 
Lazy, Messy, Backwards - Scott Porad, Start Pad, June 2009
Lazy, Messy, Backwards - Scott Porad, Start Pad, June 2009Lazy, Messy, Backwards - Scott Porad, Start Pad, June 2009
Lazy, Messy, Backwards - Scott Porad, Start Pad, June 2009
Scott Porad
 
How to avoid drastic project change (using stochastic stability)
How to avoid drastic project change (using stochastic stability)How to avoid drastic project change (using stochastic stability)
How to avoid drastic project change (using stochastic stability)
CS, NcState
 
Design-Thinking-SXSW-2016
Design-Thinking-SXSW-2016Design-Thinking-SXSW-2016
Design-Thinking-SXSW-2016
Jill DaSilva
 
Programming For Non-Programmers @ Social Media Week
Programming For Non-Programmers @ Social Media Week Programming For Non-Programmers @ Social Media Week
Programming For Non-Programmers @ Social Media Week
Chris Castiglione
 

Similar to Clean(er) Code - Tech'n'Drinks @myposter (20)

Making software
Making softwareMaking software
Making software
 
Just the basics_strata_2013
Just the basics_strata_2013Just the basics_strata_2013
Just the basics_strata_2013
 
All I Really Need To Know About Pair Programming I Learned In Kindergarten
All I Really Need To Know About Pair Programming I Learned In KindergartenAll I Really Need To Know About Pair Programming I Learned In Kindergarten
All I Really Need To Know About Pair Programming I Learned In Kindergarten
 
How to have good business ideas workshop
How to have good business ideas workshopHow to have good business ideas workshop
How to have good business ideas workshop
 
Living documentation
Living documentationLiving documentation
Living documentation
 
Modular vs Monolith
Modular vs MonolithModular vs Monolith
Modular vs Monolith
 
Designing the User Experience
Designing the User ExperienceDesigning the User Experience
Designing the User Experience
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
Good vs. Great Design
Good vs. Great DesignGood vs. Great Design
Good vs. Great Design
 
Game of Sprints
Game of SprintsGame of Sprints
Game of Sprints
 
Advancing the web without breaking it - #btconf
Advancing the web without breaking it - #btconfAdvancing the web without breaking it - #btconf
Advancing the web without breaking it - #btconf
 
Mind the Gap - State of the Browser 2015
Mind the Gap - State of the Browser 2015Mind the Gap - State of the Browser 2015
Mind the Gap - State of the Browser 2015
 
More From Less -- Ivan Beram
More From Less -- Ivan BeramMore From Less -- Ivan Beram
More From Less -- Ivan Beram
 
[Keynote] James Higgs - Quality is a variable
[Keynote] James Higgs - Quality is a variable[Keynote] James Higgs - Quality is a variable
[Keynote] James Higgs - Quality is a variable
 
Quality is a variable
Quality is a variableQuality is a variable
Quality is a variable
 
Diving into event-sourcing and event-driven architectures
Diving into event-sourcing and event-driven architecturesDiving into event-sourcing and event-driven architectures
Diving into event-sourcing and event-driven architectures
 
Lazy, Messy, Backwards - Scott Porad, Start Pad, June 2009
Lazy, Messy, Backwards - Scott Porad, Start Pad, June 2009Lazy, Messy, Backwards - Scott Porad, Start Pad, June 2009
Lazy, Messy, Backwards - Scott Porad, Start Pad, June 2009
 
How to avoid drastic project change (using stochastic stability)
How to avoid drastic project change (using stochastic stability)How to avoid drastic project change (using stochastic stability)
How to avoid drastic project change (using stochastic stability)
 
Design-Thinking-SXSW-2016
Design-Thinking-SXSW-2016Design-Thinking-SXSW-2016
Design-Thinking-SXSW-2016
 
Programming For Non-Programmers @ Social Media Week
Programming For Non-Programmers @ Social Media Week Programming For Non-Programmers @ Social Media Week
Programming For Non-Programmers @ Social Media Week
 

More from myposter GmbH

Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposterConcepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
myposter GmbH
 
ReRxSwift
ReRxSwiftReRxSwift
ReRxSwift
myposter GmbH
 
Vue - State Transitions
Vue - State TransitionsVue - State Transitions
Vue - State Transitions
myposter GmbH
 
Vue - Composing Components
Vue - Composing ComponentsVue - Composing Components
Vue - Composing Components
myposter GmbH
 
Vue - the Progressive Framework
Vue  - the Progressive FrameworkVue  - the Progressive Framework
Vue - the Progressive Framework
myposter GmbH
 
Microservices - Do one thing well
Microservices - Do one thing wellMicroservices - Do one thing well
Microservices - Do one thing well
myposter GmbH
 
Optimising Image Loading
Optimising Image LoadingOptimising Image Loading
Optimising Image Loading
myposter GmbH
 
Warum Affen die besseren Softwaretester sind
Warum Affen die besseren Softwaretester sindWarum Affen die besseren Softwaretester sind
Warum Affen die besseren Softwaretester sind
myposter GmbH
 
Reactive x
Reactive xReactive x
Reactive x
myposter GmbH
 
How Browsers Work
How Browsers Work How Browsers Work
How Browsers Work
myposter GmbH
 

More from myposter GmbH (10)

Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposterConcepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
 
ReRxSwift
ReRxSwiftReRxSwift
ReRxSwift
 
Vue - State Transitions
Vue - State TransitionsVue - State Transitions
Vue - State Transitions
 
Vue - Composing Components
Vue - Composing ComponentsVue - Composing Components
Vue - Composing Components
 
Vue - the Progressive Framework
Vue  - the Progressive FrameworkVue  - the Progressive Framework
Vue - the Progressive Framework
 
Microservices - Do one thing well
Microservices - Do one thing wellMicroservices - Do one thing well
Microservices - Do one thing well
 
Optimising Image Loading
Optimising Image LoadingOptimising Image Loading
Optimising Image Loading
 
Warum Affen die besseren Softwaretester sind
Warum Affen die besseren Softwaretester sindWarum Affen die besseren Softwaretester sind
Warum Affen die besseren Softwaretester sind
 
Reactive x
Reactive xReactive x
Reactive x
 
How Browsers Work
How Browsers Work How Browsers Work
How Browsers Work
 

Recently uploaded

Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
revolutionary575
 
04. Ruby Operators Slides - Ruby Core Teaching
04. Ruby Operators Slides - Ruby Core Teaching04. Ruby Operators Slides - Ruby Core Teaching
04. Ruby Operators Slides - Ruby Core Teaching
quanhoangd129
 
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
902basic
 
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing ToolsOld Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Benjamin Bischoff
 
Fantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdfFantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdf
6m9p7qnjj8
 
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
singhlata50dh
 
ERP Software Solutions Provider in Coimbatore
ERP Software Solutions Provider in CoimbatoreERP Software Solutions Provider in Coimbatore
ERP Software Solutions Provider in Coimbatore
Nextskill Technologies
 
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
3610stuck
 
Empowering Businesses with Intelligent Software Solutions - Grawlix
Empowering Businesses with Intelligent Software Solutions - GrawlixEmpowering Businesses with Intelligent Software Solutions - Grawlix
Empowering Businesses with Intelligent Software Solutions - Grawlix
Aarisha Shaikh
 
02. Ruby Basic slides - Ruby Core Teaching
02. Ruby Basic slides - Ruby Core Teaching02. Ruby Basic slides - Ruby Core Teaching
02. Ruby Basic slides - Ruby Core Teaching
quanhoangd129
 
SAP implementation steps PDF - Zyple Software
SAP implementation steps PDF - Zyple SoftwareSAP implementation steps PDF - Zyple Software
SAP implementation steps PDF - Zyple Software
Zyple Software
 
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdfA Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
kalichargn70th171
 
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
dream girl
 
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
John Gallagher
 
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
45unexpected
 
BATber53 AWS Modernize your applications with purpose-built AWS databases
BATber53 AWS Modernize your applications with purpose-built AWS databasesBATber53 AWS Modernize your applications with purpose-built AWS databases
BATber53 AWS Modernize your applications with purpose-built AWS databases
BATbern
 
06. Ruby Array & Hash - Ruby Core Teaching
06. Ruby Array & Hash - Ruby Core Teaching06. Ruby Array & Hash - Ruby Core Teaching
06. Ruby Array & Hash - Ruby Core Teaching
quanhoangd129
 
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
kiara pandey
 
05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching
quanhoangd129
 
07. Ruby String Slides - Ruby Core Teaching
07. Ruby String Slides - Ruby Core Teaching07. Ruby String Slides - Ruby Core Teaching
07. Ruby String Slides - Ruby Core Teaching
quanhoangd129
 

Recently uploaded (20)

Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
 
04. Ruby Operators Slides - Ruby Core Teaching
04. Ruby Operators Slides - Ruby Core Teaching04. Ruby Operators Slides - Ruby Core Teaching
04. Ruby Operators Slides - Ruby Core Teaching
 
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
 
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing ToolsOld Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
 
Fantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdfFantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdf
 
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
 
ERP Software Solutions Provider in Coimbatore
ERP Software Solutions Provider in CoimbatoreERP Software Solutions Provider in Coimbatore
ERP Software Solutions Provider in Coimbatore
 
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
 
Empowering Businesses with Intelligent Software Solutions - Grawlix
Empowering Businesses with Intelligent Software Solutions - GrawlixEmpowering Businesses with Intelligent Software Solutions - Grawlix
Empowering Businesses with Intelligent Software Solutions - Grawlix
 
02. Ruby Basic slides - Ruby Core Teaching
02. Ruby Basic slides - Ruby Core Teaching02. Ruby Basic slides - Ruby Core Teaching
02. Ruby Basic slides - Ruby Core Teaching
 
SAP implementation steps PDF - Zyple Software
SAP implementation steps PDF - Zyple SoftwareSAP implementation steps PDF - Zyple Software
SAP implementation steps PDF - Zyple Software
 
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdfA Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
 
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
 
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
 
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
 
BATber53 AWS Modernize your applications with purpose-built AWS databases
BATber53 AWS Modernize your applications with purpose-built AWS databasesBATber53 AWS Modernize your applications with purpose-built AWS databases
BATber53 AWS Modernize your applications with purpose-built AWS databases
 
06. Ruby Array & Hash - Ruby Core Teaching
06. Ruby Array & Hash - Ruby Core Teaching06. Ruby Array & Hash - Ruby Core Teaching
06. Ruby Array & Hash - Ruby Core Teaching
 
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
 
05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching
 
07. Ruby String Slides - Ruby Core Teaching
07. Ruby String Slides - Ruby Core Teaching07. Ruby String Slides - Ruby Core Teaching
07. Ruby String Slides - Ruby Core Teaching
 

Clean(er) Code - Tech'n'Drinks @myposter

  • 2. ABOUT ME MARTIN “D4RK” STRAUB ▸ iOS developer @myposter ! ▸ Guitar player @kentuckyschreit (ska/pop-punk) 🎸 ▸ Husband 💑 ▸ Cat 😺
  • 7. ABOUT ME MARTIN “D4RK” STRAUB ▸ ... ▸ ... ▸ martin-straub.de ▸ iOS developer @myposter ! ▸ Guitar player @kentuckyschreit (ska/pop-punk) 🎸 ▸ Husband 💑 ▸ Cat 😺
  • 9. EVERY PIECE OF KNOWLEDGE MUST HAVE A SINGLE, UNAMBIGUOUS, AUTHORITATIVE REPRESENTATION WITHIN A SYSTEM. The Pragmatic Programmer DON’T REPEAT YOURSELF (DRY)
  • 10. DON’T REPEAT YOURSELF (DRY) WHAT’S IT ABOUT? ▸ Don’t repeat the knowledge ▸ Avoid contradictions ▸ One source of truth
  • 11. DON’T REPEAT YOURSELF (DRY) TYPES OF DUPLICATION ▸ Imposed duplication ▸ Inadvertent duplication ▸ Impatient duplication ▸ Interdeveloper duplication
  • 12. DUPLICATION IS FAR CHEAPER THAN THE WRONG ABSTRACTION. Sandi Metz (Teacher, writer, consultant, programmer)
  • 13. A SYSTEM’S KNOWLEDGE IS FAR BROADER THAN JUST ITS CODE. DON’T REPEAT YOURSELF (DRY) The Pragmatic Programmer
  • 14. DON’T REPEAT YOURSELF (DRY) BROADER USAGE ▸ Database schemas ▸ Test plans ▸ Build system ▸ Documentation
  • 16. KEEP IT SIMPLE STUPID Kelly Johnson (Lead engineer at Lookheed Martin)
  • 17. KEEP IT SIMPLE, STUPID (KISS) WHAT’S IT ABOUT? ▸ Most systems work best if they are kept simple rather than made complicated ▸ Simplicity should be a key goal in design ▸ Unnecessary complexity should be avoided ▸ The end-user doesn’t care how smart you are ▸ If you have to explain the product, it’s too complicated
  • 18. MAKE EVERYTHING AS SIMPLE AS POSSIBLE, BUT NOT SIMPLER Albert Einstein KEEP IT SIMPLE, STUPID (KISS)
  • 20. YOU AIN’T GONNA NEED IT (YAGNI) WHAT’S IT ABOUT? ▸ 80% of the time spent on a software project is invested in 20% of the functionality ▸ Prioritize (MoSCoW) ▸ No future coding ▸ No overengineering
  • 21. MUST HAVE SHOULD HAVE COULD HAVE WON’T HAVE (THIS TIME) MoSCoW principle
  • 22. DRY VS. KISS & YAGNI SUMMARY ▸ DRY strives for abstraction ▸ KISS aims for simplicity ▸ YAGNI doesn’t want to do it at all ▸ Those principles compete with each other ▸ Find the right balance between DRY and KISS/ YAGNI
  • 24. …USE A BUCKET! WATER DRIPS FROM THE CEILING?
  • 27. ROOT CAUSE ANALYSIS (RCA) 1. REACTIVE MANAGEMENT ▸ React quickly, by treating the symptoms ▸ Goal: Ease the effects of the problem as soon as possible
  • 31. ROOT CAUSE ANALYSIS (RCA) 2. PROACTIVE MANAGEMENT ▸ Address the real cause instead of its symptoms ▸ Goal: Prevent problems from (re-)occurring
  • 32. ROOT CAUSE ANALYSIS (RCA) ROOT CAUSE ANALYSIS ▸ Identification and description ▸ Chronology ▸ Differentiation ▸ Causal graphing ▸ Next step: Trigger long-term corrective actions
  • 33. BY REPEATING WHY FIVE TIMES, THE NATURE OF THE PROBLEM AS WELL AS ITS SOLUTION BECOMES CLEAR. Taiichi Ohno ROOT CAUSE ANALYSIS (RCA) (“Father” of the Toyota Production System)
  • 34. ROOT CAUSE ANALYSIS (RCA) 5 WHYS Example: Ran through a red light. (problem) ▸ Why? - Late for work. (1st why) ▸ Why? - Woke up late. (2nd why) ▸ Why? - Alarm clock didn’t ring. (3rd why) ▸ Why? - Battery was empty. (4th why) ▸ Why? - Forgot to charge it. (5th why and root cause)
  • 35. ROOT CAUSE ANALYSIS (RCA) CONCLUSION ▸ Reactive management: quickly ease the symptoms ▸ Proactive management: actually fix the issue ▸ Only the latter can lead to a sustainable and reliable code base
  • 37. MAKE IT WORK, MAKE IT RIGHT, MAKE IT FAST. Kent Beck (Software engineer, creator of extreme programming, TDD, …)
  • 38. IT’S HARDER TO READ CODE THAN TO WRITE IT. Joel Spolsky (Co-founder of Stack Overflow)
  • 39. BUILD YOUR LOGIC ON DIRECT RELATIONS, NOT ON ASSUMPTIONS. Unknown author
  • 40. LOGIC DEPENDENCIES EXAMPLES ▸ App: Does the UI depend on the device’s orientation?
 ... or on parent view changes? ▸ Do you grab yourself a new beer every 15 minutes?
 … or every time the bottle’s empty?
  • 42. CLEAN(ER) CODE SUMMARY ▸ Play the principle game ▸ BUT: ▸ Principles are not rules ▸ Find the right balance ▸ Always use common sense ▸ Don’t get paralysed by overthinking things
  • 44. SOURCES TITLE & ABOUT ME ▸ https://twitter.com/ColucciLaw/status/1010920761043939328 ▸ martin-straub.de ▸ https://www.instagram.com/maezikatzi
  • 45. SOURCES DON’T REPEAT YOURSELF (DRY) ▸ https://pragprog.com/book/tpp/the-pragmatic-programmer ▸ https://thevaluable.dev/dry-principle-explained ▸ http://verraes.net/2014/08/dry-is-about-knowledge ▸ https://www.sandimetz.com/blog/2016/1/20/the-wrong-abstraction
  • 46. SOURCES DRY (IMAGES) ▸ https://www.flickr.com/photos/liveoncelivewild/32686776783 ▸ https://medium.com/startup-grind/even-smart-vcs-invest-in-cross-industry- clones-6a3c63f830e4 ▸ https://www.engadget.com/2016/07/27/dolly-sheep-clones-are-healthy ▸ https://www.writermag.com/writing-inspiration/the-writing-life/declutter- hoarded-story-ideas
  • 47. SOURCES KEEP IT SIMPLE, STUPID (KISS) ▸ https://en.wikipedia.org/wiki/Kelly_Johnson_(engineer) ▸ https://www.interaction-design.org/literature/article/kiss-keep-it-simple-stupid- a-design-principle ▸ https://championingscience.com/2019/03/15/everything-should-be-made-as- simple-as-possible-but-no-simpler
  • 48. SOURCES KISS (IMAGES) ▸ https://archive.triblive.com/aande/music/kiss-makeup-has-changed-but-their- impact-remains-strong ▸ https://mannerofspeaking.org/2018/03/11/simplicity-is-the-key-to-brilliance ▸ https://mostlyme-certainothers.com/2015/07/16/no-frills/simplicity-01
  • 49. SOURCES YOU AIN’T GONNA NEED IT (YAGNI) ▸ https://ronjeffries.com/articles/019-01ff/iter-yagni-skimp ▸ https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it ▸ https://en.wikipedia.org/wiki/MoSCoW_method
  • 50. SOURCES YAGNI (IMAGES) ▸ https://www.monkeyuser.com/2019/yagni ▸ https://www.developgoodhabits.com/80-20-rule ▸ http://www.thebluediamondgallery.com/wooden-tile/p/priority.html ▸ https://xkcd.com/974
  • 51. SOURCES ROOT CAUSE ANALYSIS (RCA) ▸ https://en.wikipedia.org/wiki/Root_cause_analysis ▸ https://en.wikipedia.org/wiki/5_Whys ▸ https://en.wikipedia.org/wiki/Taiichi_Ohno ▸ https://kanbanize.com/lean-management/improvement/5-whys-analysis-tool
  • 52. SOURCES RCA (IMAGES) ▸ https://twitter.com/moksony/status/809695818223681536 ▸ https://www.sueddeutsche.de/muenchen/nahverkehr-darum-tropft-es-beim-s- bahn-gleis-am-marienplatz-1.3330650 ▸ https://www.br.de/nachrichten/bayern/s-bahn-chaos-in-muenchen-stoerung- nach-wassereintritt-dauert-an,RYNZ6Kw ▸ https://twitter.com/sabbiafilms/status/912692514519502849 ▸ https://www.monkeyuser.com/2018/final-patch
  • 53. SOURCES RCA (IMAGES) 2 ▸ https://www.jaguarforums.com/forum/x-type-x400-14/multiple-codes-read- puter-106645 ▸ https://psychologyhumor.tumblr.com/post/165200208492/express- psychotherapy ▸ https://michaelwtravels.boardingarea.com/2015/06/airline-fix-plane-duct- tape-uses/travelnews-111 ▸ https://www.solarwindsmsp.com/blog/results-show-controlnow-can-make- department-proactive
  • 54. SOURCES RCA (IMAGES) 3 ▸ https://www.monkeyuser.com/2018/root-cause ▸ https://medium.com/@m.azeem111/why-statement-c2a5b1f8b0fa ▸ https://brightpast.com/how-to-use-social-media-for-proactive-reputation- management
  • 55. SOURCES MAKE IT WORK, MAKE IT RIGHT, MAKE IT FAST. ▸ https://www.thetombomb.com/2018/05/17/make-it-work-make-it-right-make- it-fast ▸ http://engineerspro.blogspot.com/2016/06/career-information-regarding- mechanical.html ▸ https://www.pixwords.solutions/tl/solution/pagliko ▸ https://www.donanimhaber.com/spacex-falcon-roketine-ait-parcanin-dunya-ya- dustugu-anin-videosunu-yayinladi--115810
  • 56. SOURCES IT’S HARDER TO READ CODE THAN TO WRITE IT. ▸ https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do- part-i
  • 57. SOURCES BUILD YOUR LOGIC ON DIRECT RELATIONS, NOT ON ASSUMPTIONS. ▸ https://www2.le.ac.uk/institution/lias/images/Fellows%203.jpg/view ▸ https://medium.com/@CodementorIO/good-developers-vs-bad-developers- fe9d2d6b582b
  • 58. SOURCES SUMMARY & SOURCES ▸ https://code.tutsplus.com/tutorials/3-key-software-principles-you-must- understand--net-25161 ▸ https://en.wikipedia.org/wiki/Analysis_paralysis ▸ https://www.mr-maid.com/blog/hiring-bad-cleaning-service ▸ https://www.acadoo.de/woran-erkenne-ich-serioese-quellen.html ▸ https://en.wikipedia.org/wiki/LOLCODE