SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
1
P R O G R A M M I N G
= !
W R I T I N G C O D E
• A L L S L I D E S A R E I N E N G L I S H
• T Y P O S M AY O C C U R
Y O U D O N ’ T K N O W E N G L I S H ?
2
3
• S O F T WA R E
E N G I N E E R
• W E B A N D M O B I L E
• R U B Y / P H P /
O B J E C T I V E C /
S W I F T
• 1 1 Y E A R S O F
E X P E R I E N C E
• Q U I M B I K , I N C /
U S A
G U S TA V O C U N H A
4
•I N F R A S T R U C T U R E ?
•S U P P O RT ?
•W O R K S ?
•P R O G R A M M I N G ?
5
P R O C E S S
W R I T I N G
T E S T I N G
M A I N T E N A N I N G
[ W I K I P E D I A ]
D E F I N E : P R O G R A M ?
6
• ~ 300 Programming Languages - Wikipedia
• Learn all of them? NO!
• Make mistakes is common and acceptable
• Which language should I learn?
Does the language really matters?!?!?!?!
F* NO!!!!!!
7
P R O G R A M M I N G I S E A S Y
8
I D O T H I S O N A D A I LY B A S I S
I N E V E R M A K E M I S TA K E S !
R E A L LY ?
H T T P : / / I . I M G U R . C O M / B T J Z E D W. J P G9
10
H T T P : / / I . I M G U R . C O M / L Z B I E . J P G
11
H T T P : / / PA S T E B I N . C O M / P T RY 5 G 2 A
Construtor
+ 40 parâmetros
PA S T I E . O R G / PA S T E S / 8 2 7 2 3 8 6
H T T P S : / / G I S T. G I T H U B . C O M /
A N O N Y M O U S /
A A 4 6 E 8 D B 0 9 8 D C B D 3 B 4 2 8
12
13
C O D E S M E L L
14
C O D E S M E L L
( … ) I S A S U R FA C E I N D I C A T I O N T H A T U S U A L LY
C O R R E S P O N D S T O A D E E P E R P R O B L E M I N T H E
S Y S T E M ( … )
K E N T B E C K
15
C O D E S M E L L
• Duplicate Code
• Long Method
• Large Class
• Long Parameter List
• + 10 more symptoms
16
D U P L I C AT E C O D E
C O D E S M E L L
17
Most common problem
Solution
• Same class, different methods
• Extract code to new method
• Different classes
• Sibling classes
• Move code to parent class
• If code is similar, but not equal, break into methods that has
same code and methods with different information
• Unrelated classes
• Check design
L O N G M E T H O D
C O D E S M E L L
18
Hard to understand, easy to solve
Solution
• Break the methods into smaller methods (subroutines)
• Big method will become a method caller
• Easier to maintain
Problems
• Hard to read
• Usually loses it’s main purpose
L A R G E C L A S S
C O D E S M E L L
19
Also known as Ninja Class
Solution
• Break the attributes into components (like address)
• Usually, attributes with same prefix/suffix is likely to become a
component
• Reduces duplicate code
Problems
• Loses it’s purpose
• Does more then one thing
• Duplicate code (often)
• Has many object-cadidates inside it
L O N G PA R A M E T E R L I S T
C O D E S M E L L
20
Change one of them and you will be in trouble
Solution
• Remove any parameters that can be retrieved from objects already
sent
Problems
• On Procedural Programming, you had to send every detail a function
needed
• On Object Oriented Programming, you can send enough to get what
the method needs
H T T P : / / W W W. A M A Z O N . C O M / G P / P R O D U C T / 0 2 0 1 4 8 5 6 7 2
21
F O R F U R T H E R I N F O R M AT I O N
I N R U B Y…
Gems
• flog - Flog shows you the most torturous code you wrote. The
more painful the code, the higher the score.
• flay - Flay analyzes ruby code for structural similarities.
Differences in literal values, names, whitespace, and
programming style are all ignored.
• reek - is a tool that examines Ruby classes, modules and methods
and reports any Code Smells it finds
• brakeman - is a static analysis tool which checks Ruby on Rails
applications for security vulnerabilities.
22
H T T P : / / W W W. S L I D E S H A R E . N E T / M A R T I N T S C H / R E FA C T O R I N G - C O D E - S M E L L
23
T W O M O R E T H I N G S …T W O M O R E T H I N G S …
24
25
18 de abril
Colégio Contato
alagoasdevday.com.br
26
Q U E S T I O N S ?
27
T H A N K Y O U !
28
Gustavo Cunha
gmmcal.com.br
[twitter|github|facebook].com/gmmcal
+GustavoCunha

Mais conteúdo relacionado

Mais procurados

Building Multi-Site in Joomla
Building Multi-Site in JoomlaBuilding Multi-Site in Joomla
Building Multi-Site in Joomlabrian teeman
 
TCS: Ad Tools, Social Marketing Tools + List Building Tools
TCS: Ad Tools, Social Marketing Tools + List Building ToolsTCS: Ad Tools, Social Marketing Tools + List Building Tools
TCS: Ad Tools, Social Marketing Tools + List Building ToolsRoland Frasier
 
Development and Deployment: The Human Factor
Development and Deployment: The Human FactorDevelopment and Deployment: The Human Factor
Development and Deployment: The Human FactorBoris Adryan
 
Comprehensive approach to delivering great developer products
Comprehensive approach to delivering great developer productsComprehensive approach to delivering great developer products
Comprehensive approach to delivering great developer productsLINE Corporation
 
Trust, Elections and Twitter (fscons 2017)
Trust, Elections and Twitter (fscons 2017)Trust, Elections and Twitter (fscons 2017)
Trust, Elections and Twitter (fscons 2017)Patricia Aas
 
TCS: Competitive Intelligence Tools - Tools Presentation Part 1
TCS: Competitive Intelligence Tools - Tools Presentation Part 1TCS: Competitive Intelligence Tools - Tools Presentation Part 1
TCS: Competitive Intelligence Tools - Tools Presentation Part 1Roland Frasier
 
Semantic BDD with ShouldIT?
Semantic BDD with ShouldIT?Semantic BDD with ShouldIT?
Semantic BDD with ShouldIT?Richard McIntyre
 
Shift Your Paradigm of Learning: From Technology-Centered to Learner-Centered
Shift Your Paradigm of Learning: From Technology-Centered to Learner-CenteredShift Your Paradigm of Learning: From Technology-Centered to Learner-Centered
Shift Your Paradigm of Learning: From Technology-Centered to Learner-CenteredRandy Ziegenfuss, Ed.D.
 
Walk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentationWalk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentationStephan Hochhaus
 
Visual note-taking: listening, learning, remembering
Visual note-taking: listening, learning, rememberingVisual note-taking: listening, learning, remembering
Visual note-taking: listening, learning, rememberingFrancis Rowland
 
Collaboration between LINE, Microsoft and AI by the developers, for the devel...
Collaboration between LINE, Microsoft and AI by the developers, for the devel...Collaboration between LINE, Microsoft and AI by the developers, for the devel...
Collaboration between LINE, Microsoft and AI by the developers, for the devel...LINE Corporation
 
Laylay14311 oovoo chat_history
Laylay14311 oovoo chat_historyLaylay14311 oovoo chat_history
Laylay14311 oovoo chat_historylaylay23
 
The Belief System
The Belief System The Belief System
The Belief System Sanjay Singh
 
Master’s voice: the rise of voice assistants
Master’s voice: the rise of voice assistantsMaster’s voice: the rise of voice assistants
Master’s voice: the rise of voice assistantsDaniel Harvey
 
Google positions for Rhinalnesc - week 1 2-3-4-5
Google positions for Rhinalnesc - week 1 2-3-4-5Google positions for Rhinalnesc - week 1 2-3-4-5
Google positions for Rhinalnesc - week 1 2-3-4-5Cedric Farineau
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsRonald Ashri
 

Mais procurados (20)

Building Multi-Site in Joomla
Building Multi-Site in JoomlaBuilding Multi-Site in Joomla
Building Multi-Site in Joomla
 
TCS: Ad Tools, Social Marketing Tools + List Building Tools
TCS: Ad Tools, Social Marketing Tools + List Building ToolsTCS: Ad Tools, Social Marketing Tools + List Building Tools
TCS: Ad Tools, Social Marketing Tools + List Building Tools
 
Development and Deployment: The Human Factor
Development and Deployment: The Human FactorDevelopment and Deployment: The Human Factor
Development and Deployment: The Human Factor
 
Comprehensive approach to delivering great developer products
Comprehensive approach to delivering great developer productsComprehensive approach to delivering great developer products
Comprehensive approach to delivering great developer products
 
Corel draw x4
Corel draw x4Corel draw x4
Corel draw x4
 
Trust, Elections and Twitter (fscons 2017)
Trust, Elections and Twitter (fscons 2017)Trust, Elections and Twitter (fscons 2017)
Trust, Elections and Twitter (fscons 2017)
 
TCS: Competitive Intelligence Tools - Tools Presentation Part 1
TCS: Competitive Intelligence Tools - Tools Presentation Part 1TCS: Competitive Intelligence Tools - Tools Presentation Part 1
TCS: Competitive Intelligence Tools - Tools Presentation Part 1
 
Semantic BDD with ShouldIT?
Semantic BDD with ShouldIT?Semantic BDD with ShouldIT?
Semantic BDD with ShouldIT?
 
Shift Your Paradigm of Learning: From Technology-Centered to Learner-Centered
Shift Your Paradigm of Learning: From Technology-Centered to Learner-CenteredShift Your Paradigm of Learning: From Technology-Centered to Learner-Centered
Shift Your Paradigm of Learning: From Technology-Centered to Learner-Centered
 
Walk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentationWalk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentation
 
Visual note-taking: listening, learning, remembering
Visual note-taking: listening, learning, rememberingVisual note-taking: listening, learning, remembering
Visual note-taking: listening, learning, remembering
 
Corel draw x4
Corel draw x4Corel draw x4
Corel draw x4
 
Collaboration between LINE, Microsoft and AI by the developers, for the devel...
Collaboration between LINE, Microsoft and AI by the developers, for the devel...Collaboration between LINE, Microsoft and AI by the developers, for the devel...
Collaboration between LINE, Microsoft and AI by the developers, for the devel...
 
Laylay14311 oovoo chat_history
Laylay14311 oovoo chat_historyLaylay14311 oovoo chat_history
Laylay14311 oovoo chat_history
 
The Belief System
The Belief System The Belief System
The Belief System
 
Денис Волошко
Денис ВолошкоДенис Волошко
Денис Волошко
 
Master’s voice: the rise of voice assistants
Master’s voice: the rise of voice assistantsMaster’s voice: the rise of voice assistants
Master’s voice: the rise of voice assistants
 
Google positions for Rhinalnesc - week 1 2-3-4-5
Google positions for Rhinalnesc - week 1 2-3-4-5Google positions for Rhinalnesc - week 1 2-3-4-5
Google positions for Rhinalnesc - week 1 2-3-4-5
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
 
Agile and Scrum Methodology
Agile and Scrum MethodologyAgile and Scrum Methodology
Agile and Scrum Methodology
 

Destaque

Mobile Is Eating the World (2016)
Mobile Is Eating the World (2016)Mobile Is Eating the World (2016)
Mobile Is Eating the World (2016)a16z
 
Visual Computing: The Road Ahead, NVIDIA CEO Jen-Hsun Huang at CES 2015
Visual Computing: The Road Ahead, NVIDIA CEO Jen-Hsun Huang at CES 2015 Visual Computing: The Road Ahead, NVIDIA CEO Jen-Hsun Huang at CES 2015
Visual Computing: The Road Ahead, NVIDIA CEO Jen-Hsun Huang at CES 2015 NVIDIA
 
10 of the Biggest Stories in Technology
10 of the Biggest Stories in Technology10 of the Biggest Stories in Technology
10 of the Biggest Stories in TechnologyBrett Cotham
 
Hacking the Web
Hacking the WebHacking the Web
Hacking the WebMike Crabb
 
Let Non-Developers Develop your Site. Manu Raivio
Let Non-Developers Develop your Site. Manu RaivioLet Non-Developers Develop your Site. Manu Raivio
Let Non-Developers Develop your Site. Manu RaivioFuture Insights
 
What I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginnersWhat I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginnersEtiene Dalcol
 
Pair Programming demystified
Pair Programming demystifiedPair Programming demystified
Pair Programming demystifiedDaftcode
 
What is JSON-FP
What is JSON-FPWhat is JSON-FP
What is JSON-FPBen Lue
 
The Tester Role & Scrum
The Tester Role & ScrumThe Tester Role & Scrum
The Tester Role & ScrumJohan Hoberg
 
Python for R developers and data scientists
Python for R developers and data scientistsPython for R developers and data scientists
Python for R developers and data scientistsLambda Tree
 
Types of Production and Manufacturing
Types of Production and ManufacturingTypes of Production and Manufacturing
Types of Production and ManufacturingCasey Robertson
 
Wearable - storytelling or storydoing - Yiannis Lapatas
Wearable - storytelling or storydoing - Yiannis LapatasWearable - storytelling or storydoing - Yiannis Lapatas
Wearable - storytelling or storydoing - Yiannis LapatasIABRomania
 
Appraiser : How Airbnb Generates Complex Models in Spark for Demand Prediction
Appraiser : How Airbnb Generates Complex Models in Spark for Demand PredictionAppraiser : How Airbnb Generates Complex Models in Spark for Demand Prediction
Appraiser : How Airbnb Generates Complex Models in Spark for Demand PredictionYang Li Hector Yee
 
Writing Code That Lasts - Joomla!Dagen 2015
Writing Code That Lasts - Joomla!Dagen 2015Writing Code That Lasts - Joomla!Dagen 2015
Writing Code That Lasts - Joomla!Dagen 2015Rafael Dohms
 
The Rise of Wearable Technology
The Rise of Wearable Technology  The Rise of Wearable Technology
The Rise of Wearable Technology Jonathan LeBlanc
 
Engineering your culture how to keep your engineers happy
Engineering your culture   how to keep your engineers happyEngineering your culture   how to keep your engineers happy
Engineering your culture how to keep your engineers happyAgilePractitionersIL
 
3D print for manufacturing
3D print for manufacturing3D print for manufacturing
3D print for manufacturingGal Raz
 

Destaque (19)

Mobile Is Eating the World (2016)
Mobile Is Eating the World (2016)Mobile Is Eating the World (2016)
Mobile Is Eating the World (2016)
 
Visual Computing: The Road Ahead, NVIDIA CEO Jen-Hsun Huang at CES 2015
Visual Computing: The Road Ahead, NVIDIA CEO Jen-Hsun Huang at CES 2015 Visual Computing: The Road Ahead, NVIDIA CEO Jen-Hsun Huang at CES 2015
Visual Computing: The Road Ahead, NVIDIA CEO Jen-Hsun Huang at CES 2015
 
10 of the Biggest Stories in Technology
10 of the Biggest Stories in Technology10 of the Biggest Stories in Technology
10 of the Biggest Stories in Technology
 
Hacking the Web
Hacking the WebHacking the Web
Hacking the Web
 
Let Non-Developers Develop your Site. Manu Raivio
Let Non-Developers Develop your Site. Manu RaivioLet Non-Developers Develop your Site. Manu Raivio
Let Non-Developers Develop your Site. Manu Raivio
 
What I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginnersWhat I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginners
 
Pair Programming demystified
Pair Programming demystifiedPair Programming demystified
Pair Programming demystified
 
The Programmer
The ProgrammerThe Programmer
The Programmer
 
What is JSON-FP
What is JSON-FPWhat is JSON-FP
What is JSON-FP
 
The Tester Role & Scrum
The Tester Role & ScrumThe Tester Role & Scrum
The Tester Role & Scrum
 
Python for R developers and data scientists
Python for R developers and data scientistsPython for R developers and data scientists
Python for R developers and data scientists
 
Types of Production and Manufacturing
Types of Production and ManufacturingTypes of Production and Manufacturing
Types of Production and Manufacturing
 
Avr lecture8
Avr lecture8Avr lecture8
Avr lecture8
 
Wearable - storytelling or storydoing - Yiannis Lapatas
Wearable - storytelling or storydoing - Yiannis LapatasWearable - storytelling or storydoing - Yiannis Lapatas
Wearable - storytelling or storydoing - Yiannis Lapatas
 
Appraiser : How Airbnb Generates Complex Models in Spark for Demand Prediction
Appraiser : How Airbnb Generates Complex Models in Spark for Demand PredictionAppraiser : How Airbnb Generates Complex Models in Spark for Demand Prediction
Appraiser : How Airbnb Generates Complex Models in Spark for Demand Prediction
 
Writing Code That Lasts - Joomla!Dagen 2015
Writing Code That Lasts - Joomla!Dagen 2015Writing Code That Lasts - Joomla!Dagen 2015
Writing Code That Lasts - Joomla!Dagen 2015
 
The Rise of Wearable Technology
The Rise of Wearable Technology  The Rise of Wearable Technology
The Rise of Wearable Technology
 
Engineering your culture how to keep your engineers happy
Engineering your culture   how to keep your engineers happyEngineering your culture   how to keep your engineers happy
Engineering your culture how to keep your engineers happy
 
3D print for manufacturing
3D print for manufacturing3D print for manufacturing
3D print for manufacturing
 

Semelhante a Programming != Writing Code

Web development with tests
Web development with testsWeb development with tests
Web development with testsGustavo Cunha
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsRonald Ashri
 
TDD Using the SOLID Principles
TDD Using the SOLID PrinciplesTDD Using the SOLID Principles
TDD Using the SOLID PrinciplesJenna Pederson
 
So You Want to Start Refactoring?
So You Want to Start Refactoring?So You Want to Start Refactoring?
So You Want to Start Refactoring?jillianefoley
 
Reducing Resistance: Deployment as Surface
Reducing Resistance: Deployment as SurfaceReducing Resistance: Deployment as Surface
Reducing Resistance: Deployment as SurfaceJeffrey Hulten
 
Ninja Correlation of APT Binaries
Ninja Correlation of APT BinariesNinja Correlation of APT Binaries
Ninja Correlation of APT BinariesCODE BLUE
 
Architecting your IT career
Architecting your IT careerArchitecting your IT career
Architecting your IT careerJohn Mark Troyer
 
From Data Points to Data Lakes
From Data Points to Data LakesFrom Data Points to Data Lakes
From Data Points to Data LakesJesus Rogel
 
PowerPoint Presentation about Programming 101 for Girls
PowerPoint Presentation about Programming 101 for GirlsPowerPoint Presentation about Programming 101 for Girls
PowerPoint Presentation about Programming 101 for GirlsImelda Reyes
 
Switching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileSwitching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileDoc Norton
 
UX in E-commerce & Conversion
UX in E-commerce & ConversionUX in E-commerce & Conversion
UX in E-commerce & ConversionElymar Apao
 
Chris Wróbel (vRational): Using VR and Imitation Machine Learning Algorithms ...
Chris Wróbel (vRational): Using VR and Imitation Machine Learning Algorithms ...Chris Wróbel (vRational): Using VR and Imitation Machine Learning Algorithms ...
Chris Wróbel (vRational): Using VR and Imitation Machine Learning Algorithms ...AugmentedWorldExpo
 
Hotel Tonight - Mobile Innovation Summit
Hotel Tonight - Mobile Innovation SummitHotel Tonight - Mobile Innovation Summit
Hotel Tonight - Mobile Innovation Summitkendrickapp
 
Reduce, Reuse, Refactor
Reduce, Reuse, RefactorReduce, Reuse, Refactor
Reduce, Reuse, Refactorcklosowski
 
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?Keita Bando
 
Evaluacion sofia serrano 6 a
Evaluacion sofia serrano 6 aEvaluacion sofia serrano 6 a
Evaluacion sofia serrano 6 asamuel0711
 

Semelhante a Programming != Writing Code (20)

Witchcraft
WitchcraftWitchcraft
Witchcraft
 
Web development with tests
Web development with testsWeb development with tests
Web development with tests
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
 
TDD Using the SOLID Principles
TDD Using the SOLID PrinciplesTDD Using the SOLID Principles
TDD Using the SOLID Principles
 
So You Want to Start Refactoring?
So You Want to Start Refactoring?So You Want to Start Refactoring?
So You Want to Start Refactoring?
 
Reducing Resistance: Deployment as Surface
Reducing Resistance: Deployment as SurfaceReducing Resistance: Deployment as Surface
Reducing Resistance: Deployment as Surface
 
Ninja Correlation of APT Binaries
Ninja Correlation of APT BinariesNinja Correlation of APT Binaries
Ninja Correlation of APT Binaries
 
Architecting your IT career
Architecting your IT careerArchitecting your IT career
Architecting your IT career
 
From Data Points to Data Lakes
From Data Points to Data LakesFrom Data Points to Data Lakes
From Data Points to Data Lakes
 
PowerPoint Presentation about Programming 101 for Girls
PowerPoint Presentation about Programming 101 for GirlsPowerPoint Presentation about Programming 101 for Girls
PowerPoint Presentation about Programming 101 for Girls
 
Switching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileSwitching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to Agile
 
UX in E-commerce & Conversion
UX in E-commerce & ConversionUX in E-commerce & Conversion
UX in E-commerce & Conversion
 
Chris Wróbel (vRational): Using VR and Imitation Machine Learning Algorithms ...
Chris Wróbel (vRational): Using VR and Imitation Machine Learning Algorithms ...Chris Wróbel (vRational): Using VR and Imitation Machine Learning Algorithms ...
Chris Wróbel (vRational): Using VR and Imitation Machine Learning Algorithms ...
 
Hotel Tonight - Mobile Innovation Summit
Hotel Tonight - Mobile Innovation SummitHotel Tonight - Mobile Innovation Summit
Hotel Tonight - Mobile Innovation Summit
 
Take the red pill
Take the red pillTake the red pill
Take the red pill
 
Agree to Disagree
Agree to DisagreeAgree to Disagree
Agree to Disagree
 
Reduce, Reuse, Refactor
Reduce, Reuse, RefactorReduce, Reuse, Refactor
Reduce, Reuse, Refactor
 
Facilities for Agile
Facilities for AgileFacilities for Agile
Facilities for Agile
 
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
 
Evaluacion sofia serrano 6 a
Evaluacion sofia serrano 6 aEvaluacion sofia serrano 6 a
Evaluacion sofia serrano 6 a
 

Último

Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

Último (20)

Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

Programming != Writing Code

  • 1. 1 P R O G R A M M I N G = ! W R I T I N G C O D E
  • 2. • A L L S L I D E S A R E I N E N G L I S H • T Y P O S M AY O C C U R Y O U D O N ’ T K N O W E N G L I S H ? 2
  • 3. 3
  • 4. • S O F T WA R E E N G I N E E R • W E B A N D M O B I L E • R U B Y / P H P / O B J E C T I V E C / S W I F T • 1 1 Y E A R S O F E X P E R I E N C E • Q U I M B I K , I N C / U S A G U S TA V O C U N H A 4
  • 5. •I N F R A S T R U C T U R E ? •S U P P O RT ? •W O R K S ? •P R O G R A M M I N G ? 5
  • 6. P R O C E S S W R I T I N G T E S T I N G M A I N T E N A N I N G [ W I K I P E D I A ] D E F I N E : P R O G R A M ? 6
  • 7. • ~ 300 Programming Languages - Wikipedia • Learn all of them? NO! • Make mistakes is common and acceptable • Which language should I learn? Does the language really matters?!?!?!?! F* NO!!!!!! 7
  • 8. P R O G R A M M I N G I S E A S Y 8 I D O T H I S O N A D A I LY B A S I S I N E V E R M A K E M I S TA K E S ! R E A L LY ?
  • 9. H T T P : / / I . I M G U R . C O M / B T J Z E D W. J P G9
  • 10. 10 H T T P : / / I . I M G U R . C O M / L Z B I E . J P G
  • 11. 11 H T T P : / / PA S T E B I N . C O M / P T RY 5 G 2 A Construtor + 40 parâmetros
  • 12. PA S T I E . O R G / PA S T E S / 8 2 7 2 3 8 6 H T T P S : / / G I S T. G I T H U B . C O M / A N O N Y M O U S / A A 4 6 E 8 D B 0 9 8 D C B D 3 B 4 2 8 12
  • 13. 13 C O D E S M E L L
  • 14. 14
  • 15. C O D E S M E L L ( … ) I S A S U R FA C E I N D I C A T I O N T H A T U S U A L LY C O R R E S P O N D S T O A D E E P E R P R O B L E M I N T H E S Y S T E M ( … ) K E N T B E C K 15
  • 16. C O D E S M E L L • Duplicate Code • Long Method • Large Class • Long Parameter List • + 10 more symptoms 16
  • 17. D U P L I C AT E C O D E C O D E S M E L L 17 Most common problem Solution • Same class, different methods • Extract code to new method • Different classes • Sibling classes • Move code to parent class • If code is similar, but not equal, break into methods that has same code and methods with different information • Unrelated classes • Check design
  • 18. L O N G M E T H O D C O D E S M E L L 18 Hard to understand, easy to solve Solution • Break the methods into smaller methods (subroutines) • Big method will become a method caller • Easier to maintain Problems • Hard to read • Usually loses it’s main purpose
  • 19. L A R G E C L A S S C O D E S M E L L 19 Also known as Ninja Class Solution • Break the attributes into components (like address) • Usually, attributes with same prefix/suffix is likely to become a component • Reduces duplicate code Problems • Loses it’s purpose • Does more then one thing • Duplicate code (often) • Has many object-cadidates inside it
  • 20. L O N G PA R A M E T E R L I S T C O D E S M E L L 20 Change one of them and you will be in trouble Solution • Remove any parameters that can be retrieved from objects already sent Problems • On Procedural Programming, you had to send every detail a function needed • On Object Oriented Programming, you can send enough to get what the method needs
  • 21. H T T P : / / W W W. A M A Z O N . C O M / G P / P R O D U C T / 0 2 0 1 4 8 5 6 7 2 21 F O R F U R T H E R I N F O R M AT I O N
  • 22. I N R U B Y… Gems • flog - Flog shows you the most torturous code you wrote. The more painful the code, the higher the score. • flay - Flay analyzes ruby code for structural similarities. Differences in literal values, names, whitespace, and programming style are all ignored. • reek - is a tool that examines Ruby classes, modules and methods and reports any Code Smells it finds • brakeman - is a static analysis tool which checks Ruby on Rails applications for security vulnerabilities. 22
  • 23. H T T P : / / W W W. S L I D E S H A R E . N E T / M A R T I N T S C H / R E FA C T O R I N G - C O D E - S M E L L 23
  • 24. T W O M O R E T H I N G S …T W O M O R E T H I N G S … 24
  • 25. 25 18 de abril Colégio Contato alagoasdevday.com.br
  • 26. 26
  • 27. Q U E S T I O N S ? 27
  • 28. T H A N K Y O U ! 28 Gustavo Cunha gmmcal.com.br [twitter|github|facebook].com/gmmcal +GustavoCunha