SlideShare a Scribd company logo
Refactoring: Code it clean
englishninjas
Ali Germiyanoglu
TDD
Agile
You have no
idea!
What is it, can we eat it?
Martin Fowler
“a change made to the internal structure of software to
make it easier to understand and cheaper to modify
without changing its observable behavior”
Noun
:
Verb:
“to restructure software by applying a series of
refactorings without changing its observable behavior”
understand
track the bugs
do things faster
Improves the Design of Software
Helps you to:
Why lose time, lets focus on new features!
Code review
Adding a function
Bug fix
When shall we do it?
Apply one of the
refactoring
methods
Check if your
tests still
pass
Keep
refactoring
Fix the
problem
How to ?
–Kent Beck
“I'm not a great programmer; I'm just a good
programmer with great habits.”
Code Smell
Conditional
Complexity
Long Method
Conditional
Complexity
Long Method
Conditional
Complexity
Lazy Class
Long Method
Conditional
Complexity
Feature Envy
Lazy Class
Long Method
Conditional
Complexity
Type Embedded in
Name
Feature Envy
Lazy Class
Long Method
Long
Parameter List
Conditional
Complexity
Type Embedded in
Name
Feature Envy
Lazy Class
Long Method
Long
Parameter List
Conditional
Complexity
Large
Class
Type Embedded in
Name
Feature Envy
Lazy Class
Long Method
Long
Parameter List
Conditional
Complexity
Large
Class
Type Embedded in
Name
Oddball
Solutio
n
Feature Envy
Lazy Class
MOTIVATION
Long method
Unclear purpose
MOTIVATION
Mechanics
Create new method
Extract partial code
Call newly created method
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Complicated expressions
difficult to read
MOTIVATION
Mechanics
Declare final temporary variable
Use it
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
As you learn more about the problem and
realize that there is an easier way to do it
MOTIVATION
Mechanics
Prepare your alternative algoritm
Test your new algorithm
Replace it
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Encapsulation
As you become more sophisticated, you realize there is
more you can encapsulate
MOTIVATION
Mechanics
Hide implementation details by creating
extra delegate methods
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
–Kent Beck
The list of techniques is only the beginning. It is the gate you must
pass through. Without the techniques, you can't manipulate the
design of running programs. With them, you still can't, but at least
you can start.
MOTIVATION
You have sequence of conditional
tests with same result
MOTIVATION
Example
MOTIVATION
Example
MOTIVATION
Example
MOTIVATION
Example
MOTIVATION
Example
MOTIVATION
Example
MOTIVATION
Behaviour difference according to
type of object
Because you like OO
MOTIVATION
Mechanics
Move each leg of the conditional to an overriding
method in a subclass. Make the original method
abstract.
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Mechanics
Example
MOTIVATION
Method returns a value but also
changes the state of the object
Not cool with testing!
MOTIVATION
Mechanics
Just divide method into two
different methods
Hide method &
variables
Rename method
Hide method &
variables
Rename method
Hide method &
variables
Encapsulate collection
Rename method
Change value to reference
Hide method &
variables
Encapsulate collection
Rename method
Change value to reference
Hide method &
variables
Change reference to value
Encapsulate collection
Rename method
Change value to reference
Hide method &
variables
Change reference to value
Encapsulate collection
Remove assignments to
parameters
Rename method
Change value to reference
Hide method &
variables
Change reference to value
Encapsulate collection
Remove assignments to
parameters
Remove Control Flags
Rename method
Change value to reference
Hide method &
variables
Change reference to value
Encapsulate collection
Remove assignments to
parameters
Remove Control Flags
Tease Apart Inheritance
Rename method
Change value to reference
Hide method &
variables
Change reference to value
Encapsulate collection
Remove assignments to
parameters
Remove Control Flags
Tease Apart Inheritance
Seperate Domain from
Presentation
Rename method
Change value to reference
Hide method &
variables
Change reference to value
Encapsulate collection
Convert procedural
design to objects
Remove assignments to
parameters
Remove Control Flags
Tease Apart Inheritance
Seperate Domain from
Presentation
Any fool can write code that a computer can understand. Good
programmers write code that humans can understand
(http://hoaxes.org/photo_database/image/the_tip_of_the_iceberg
)
Tip of the iceberg
(https://blog.codinghorror.com/code-smells/)Code smell
Refactoring by Martin Fowler

More Related Content

What's hot

Refactoring: Improve the design of existing code
Refactoring: Improve the design of existing codeRefactoring: Improve the design of existing code
Refactoring: Improve the design of existing code
Valerio Maggio
 
How to get reviewers to block your changes
How to get reviewers to block your changesHow to get reviewers to block your changes
How to get reviewers to block your changes
kevintbenton
 
Episode 21 - Design Pattern 1
Episode 21 - Design Pattern 1Episode 21 - Design Pattern 1
Episode 21 - Design Pattern 1
Jitendra Zaa
 
Episode 3 – Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 – Classes, Inheritance, Abstract Class, and InterfacesEpisode 3 – Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 – Classes, Inheritance, Abstract Class, and Interfaces
Jitendra Zaa
 
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Kaunas Java User Group
 
ABAPCodeRetreat 23.7.2016 - Unit Testing
ABAPCodeRetreat 23.7.2016 - Unit TestingABAPCodeRetreat 23.7.2016 - Unit Testing
ABAPCodeRetreat 23.7.2016 - Unit Testing
ABAPCodeRetreat
 
How to make your model happy again @PyData Florence @PyConIT
How to make your model happy again @PyData Florence @PyConITHow to make your model happy again @PyData Florence @PyConIT
How to make your model happy again @PyData Florence @PyConIT
Alessia Marcolini
 
Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
Charles Nurse
 
Adventures with Microservices
Adventures with MicroservicesAdventures with Microservices
Adventures with Microservices
Anand Agrawal
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
Sarah Dutkiewicz
 
Win at life with unit testing
Win at life with unit testingWin at life with unit testing
Win at life with unit testing
markstory
 
DIG1108C Lesson 7 Fall 2014
DIG1108C Lesson 7 Fall 2014DIG1108C Lesson 7 Fall 2014
DIG1108C Lesson 7 Fall 2014
David Wolfpaw
 

What's hot (12)

Refactoring: Improve the design of existing code
Refactoring: Improve the design of existing codeRefactoring: Improve the design of existing code
Refactoring: Improve the design of existing code
 
How to get reviewers to block your changes
How to get reviewers to block your changesHow to get reviewers to block your changes
How to get reviewers to block your changes
 
Episode 21 - Design Pattern 1
Episode 21 - Design Pattern 1Episode 21 - Design Pattern 1
Episode 21 - Design Pattern 1
 
Episode 3 – Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 – Classes, Inheritance, Abstract Class, and InterfacesEpisode 3 – Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 – Classes, Inheritance, Abstract Class, and Interfaces
 
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
 
ABAPCodeRetreat 23.7.2016 - Unit Testing
ABAPCodeRetreat 23.7.2016 - Unit TestingABAPCodeRetreat 23.7.2016 - Unit Testing
ABAPCodeRetreat 23.7.2016 - Unit Testing
 
How to make your model happy again @PyData Florence @PyConIT
How to make your model happy again @PyData Florence @PyConITHow to make your model happy again @PyData Florence @PyConIT
How to make your model happy again @PyData Florence @PyConIT
 
Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
 
Adventures with Microservices
Adventures with MicroservicesAdventures with Microservices
Adventures with Microservices
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Win at life with unit testing
Win at life with unit testingWin at life with unit testing
Win at life with unit testing
 
DIG1108C Lesson 7 Fall 2014
DIG1108C Lesson 7 Fall 2014DIG1108C Lesson 7 Fall 2014
DIG1108C Lesson 7 Fall 2014
 

Similar to Refactoring: Code it Clean

Lecture: Refactoring
Lecture: RefactoringLecture: Refactoring
Lecture: Refactoring
Marcus Denker
 
Soild principles
Soild principlesSoild principles
Soild principles
Avidnyat Chiddarwar
 
Speeding up web_application
Speeding up web_applicationSpeeding up web_application
Speeding up web_application
Achintya Kumar
 
Code Refactoring using rails
Code Refactoring using railsCode Refactoring using rails
Code Refactoring using rails
Achintya Kumar
 
Refactoring Tips by Martin Fowler
Refactoring Tips by Martin FowlerRefactoring Tips by Martin Fowler
Refactoring Tips by Martin Fowler
Igor Crvenov
 
Refactoring
RefactoringRefactoring
Refactoring
AngelLuisBlasco
 
Unit Testing Full@
Unit Testing Full@Unit Testing Full@
Unit Testing Full@
Alex Borsuk
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - Refactoring
Diaa Al-Salehi
 
Getting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataGetting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and Data
Cory Foy
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
Basavaraj Patil
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
L&T Technology Services Limited
 
Behavioral design patterns presentation
Behavioral design patterns presentationBehavioral design patterns presentation
Behavioral design patterns presentation
Mina Ayoub
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
RoyKlein
 
Object Oriented Design SOLID Principles
Object Oriented Design SOLID PrinciplesObject Oriented Design SOLID Principles
Object Oriented Design SOLID Principles
rainynovember12
 
Functional JavaScript Fundamentals
Functional JavaScript FundamentalsFunctional JavaScript Fundamentals
Functional JavaScript Fundamentals
Srdjan Strbanovic
 
Agile korea 2013 유석문
Agile korea 2013 유석문Agile korea 2013 유석문
Agile korea 2013 유석문
Sangcheol Hwang
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
jinaldesailive
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
nikhil sreeni
 
Refactoring Techniques
Refactoring TechniquesRefactoring Techniques
Refactoring Techniques
Mayada Ghanem
 
Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023
Scott Keck-Warren
 

Similar to Refactoring: Code it Clean (20)

Lecture: Refactoring
Lecture: RefactoringLecture: Refactoring
Lecture: Refactoring
 
Soild principles
Soild principlesSoild principles
Soild principles
 
Speeding up web_application
Speeding up web_applicationSpeeding up web_application
Speeding up web_application
 
Code Refactoring using rails
Code Refactoring using railsCode Refactoring using rails
Code Refactoring using rails
 
Refactoring Tips by Martin Fowler
Refactoring Tips by Martin FowlerRefactoring Tips by Martin Fowler
Refactoring Tips by Martin Fowler
 
Refactoring
RefactoringRefactoring
Refactoring
 
Unit Testing Full@
Unit Testing Full@Unit Testing Full@
Unit Testing Full@
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - Refactoring
 
Getting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataGetting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and Data
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
 
Behavioral design patterns presentation
Behavioral design patterns presentationBehavioral design patterns presentation
Behavioral design patterns presentation
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
 
Object Oriented Design SOLID Principles
Object Oriented Design SOLID PrinciplesObject Oriented Design SOLID Principles
Object Oriented Design SOLID Principles
 
Functional JavaScript Fundamentals
Functional JavaScript FundamentalsFunctional JavaScript Fundamentals
Functional JavaScript Fundamentals
 
Agile korea 2013 유석문
Agile korea 2013 유석문Agile korea 2013 유석문
Agile korea 2013 유석문
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Refactoring Techniques
Refactoring TechniquesRefactoring Techniques
Refactoring Techniques
 
Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023
 

Recently uploaded

FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
PreethaV16
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
Lubi Valves
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
AI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdfAI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdf
mahaffeycheryld
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Presentation on Food Delivery Systems
Presentation on Food Delivery SystemsPresentation on Food Delivery Systems
Presentation on Food Delivery Systems
Abdullah Al Noman
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
Kamal Acharya
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
wafawafa52
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
DharmaBanothu
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
nikshimanasa
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Massimo Talia
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
OKORIE1
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
Pallavi Sharma
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 

Recently uploaded (20)

FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
AI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdfAI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdf
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Presentation on Food Delivery Systems
Presentation on Food Delivery SystemsPresentation on Food Delivery Systems
Presentation on Food Delivery Systems
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 

Refactoring: Code it Clean

Editor's Notes

  1. Scratching the surface Refactoring is at the core of TDD & Agile Same guys who builds the modern software terminologies Actually its documentation of methods they have been using for readable, testable, maintainable software Today its all about restructure the code, basic level
  2. Mention about the book Your definition
  3. quality. Improving design, improving readability, reducing bugs, all these improve quality. But doesn't all this reduce the speed of development? good design is essential for rapid software development spend time finding and fixing bugs instead of adding new function. Changes take longer as you try to understand the system and find the duplicate code
  4. Surekli yeni featurelar, yeni kurallar, yaz yaz yaz nereye kadar refactor olmayan kod legacy x
  5. - More methodological approach
  6. We don’t have tests! Mention about TDD vs testable code Way of thinking
  7. Feature Envy: Methods that make extensive use of another class may belong in another class. Consider moving this method to the class it is so envious of. Lazy Class: Classes should pull their weight. Every additional class increases the complexity of a project. If you have a class that isn't doing enough to pay for itself, can it be collapsed or combined into another class? Large Class: Large classes, like long methods, are difficult to read, understand, and troubleshoot. Does the class contain too many responsibilities? Can the large class be restructured or broken into smaller classes? Type Embedded in Name: Avoid placing types in method names; it's not only redundant, but it forces you to change the name if the type changes. Oddball Solution: There should only be one way of solving the same problem in your code. If you find an oddball solution, it could be a case of poorly duplicated code-- or it could be an argument for the adapter model, if you really need multiple solutions to the same problem.
  8. Think of your code, not basic examples In here What are your code smells ?
  9. - Does this need comment; code itself is a way of commenting
  10. - Multiple refactoring methods used!
  11. - Finish / Continue ?
  12. - Simplification, readability, testability
  13. - let the caller call multiple callees
  14. - Swift access methods internal, private fileprivate public open
  15. Naming conventions, enums, classes Method functionality
  16. Users transactions, would not know if transaction list just exposed Instead you can create add/RemoveTransaction to User object
  17. Swift function parameters in/out when to use copy by value or copy by reference - Data types such as int, date value its can be copied its ok, But what if I copy a student & want to change her grade !, Will all system be affected ?
  18. Swift function parameters in/out when to use copy by value or copy by reference
  19. Similar to reference/value types
  20. - flag programming
  21. Design refactor nothing like here!
  22. Design refactor nothing like here!
  23. Last 3 methods are ‘Design Refactor’; nothing like here!