SlideShare una empresa de Scribd logo
1 de 37
Adam Culp @adamculp
https://joind.in/10797
Clean Application Development
Page  2
● About Me
●
PHP 5.3 Certified
●
Consultant at Zend Technologies
●
Organizer – SoFloPHP (South Florida)
●
Organized – SunshinePHP (Miami)
●
Long distance (ultra) runner
●
Judo Black Belt Instructor
Clean Application Development – About Me
Page  3
● I love iteration!
●
Evolution.
●
Learning to walk.
●
Training to run.
●
Evading project managers.
●
Clean development.
Clean Application Development – Iteration
Page  4
● Clean application development cannot be taught in 45 minutes
●
Practice, Practice, Practice.
●
Leave the code better than you found it.
●
Always watch for new techniques.
●
No “silver bullet“.
Clean Application Development – Learning
Page  5
● A great resource on code quality.
Clean Application Development – Resources
Clean Code
By Robert C. Martin
Page  6
● Disasters happen, resulting in bad code...
●
It's easy
●
Short deadlines
●
Boss
●
Laziness
●
Lack of “how-to“
●
Come back and clean later
●
We are the cause!
Clean Application Development – Causes of bad code
Page  7
● Bad code starts innocently
● Hire a new
professional/developer
●
Clean slate, no expectations
● Start a new project
●
Initial code output is quick and easy,
setting expectation
●
Slows down over time
●
Complexity increases
●
Domino effect
Clean Application Development – Typical Scenario
Page  8
● Our responsibility to say “NO“
●
Managers job = defend schedule and features
●
Our job = defend the code
●
Managers respect realistic reasons and explanations
Clean Application Development – Defend the code
Page  9
● Others judge us on our code
●
We are @authors.
●
75% of time reading code
●
Others read our code also
●
And they talk about it!
●
How developers talk about us = “CRED“
Clean Application Development – We are judged
And they talk about it!
Page  10
● Side-effects of bad code:
●
Wasted Time
●
Bugs
●
Excessive debugging
●
Procrastination
●
Missed deadlines
●
Technical debt
●
Financial losses
Clean Application Development – Result of bad code
Page  11
● How we typically react to a dirty application:
●
Padded estimates
●
Developers Hide
●
Become defensive
●
Blame others/requirements
●
Add developers
●
Rewrite!
Clean Application Development – The aftermath
Page  12
● The problem with a rewrite:
●
Development team split, old/new
●
Legacy application enhanced
●
New application Scope creep
●
Is it done yet?
●
Ends with more bad code!
Clean Application Development – Rewrite problems
Page  13
● Learn to Refactor.
Clean Application Development – Resources
Refactoring 101
By Adam Culp
Refactoring
By Martin Fowler
https://github.com/adamculp/refactoring101 https://refactoring101.com
Page  14
● With all of these problems, clean applications makes sense
●
Shortens development time.
●
On-boarding of developers easier.
●
Less bugs.
●
Happier end-users.
●
Predictable schedules.
●
It's the professional thing to do.
Clean Application Development – Common sense
Page  15
● Coding Standards save time
●
Gives direction
●
PHP Framework Interoperability Group (https://www.php-fig.org).
●
PSR-0 Autoloading Standard
●
PSR-1 Basic Coding Standard
●
PSR-2 Coding Style Guide
●
PSR-3 Logging
●
PSR-4 Improved Autoloading
●
Standard NOT important
●
Choose one
●
Stick with it
●
Consistency is key
Clean Application Development – Coding standards
Page  16
● Names should be clear
●
Functions and variables should tell a story.
Clean Application Development – Clear names
$elapsedTimeInDays;
$daysSinceCreation;
$daysSinceModified;
$fileAgeInDays;
$elapsed;
$createdDays;
$modifiedDays;
$age;
GoodBad
Page  17
● Shy away from variations of the same name
●
To ensure names are different enough to portray difference.
Clean Application Development – No confusion
$product
$productInfo
$productData
$productDescription
What is the difference between these?
Page  18
● Certain characters are hard to understand
Clean Application Development – Bad characters
Lower case L
Uppercase O (oh)
Uppercase I (eye)
Bad
Page  19
● Technical names help developers who actually read the code.
● Non-technical terms for client documentation.
● Class names should be nouns
●
Describe.
●
Ex. - Customer, Account, Product, Company.
● Method names should be verbs
●
Action.
●
Ex. - getCustomer, closeAccount, updateProduct, addCompany.
●
Pick a set of keywords and stick with them.
●
Ex. - fetch, get, add, update, remove, delete
Clean Application Development – Name grammar
Page  20
● More on Clean Code
●
Functions:
●
Short
●
Single purpose
●
As expected
●
Well named
●
Recognizing bad doesn't mean we know how to make good
●
We know a good/bad song, but are not song writers
●
Clean code = caring developer
●
Does not require many comments
Clean Application Development – Clean code
Page  21
● Comments can also be a bad “smell“
●
Comments are often used to cover up bad code.
●
Code should be self-documenting
Clean Application Development – Code comments
Page  22
● How to spot bad code (smells)
●
Incomplete error handling
●
Memory leaks
●
Race conditions
●
Inconsistent naming convention (class, function, variable)
●
Inconsistent coding standard
●
Un-initialized variables
●
Code lacks clear purpose
●
Functions do too much (more than one thing)
●
Globals used
●
Too many comments in the code
●
Notices, Warnings, Fatal Errors
Clean Application Development – Smells of bad code
Page  23
● Let PHP CodeSniffer detect bad smells
●
Set rules to detect if coding standard is not followed
●
Run during commits in version control
●
PhpStorm integration
Clean Application Development – Code sniffer
Page  24
● Peer code review great learning tool
●
Peers help train each other on strong points.
●
Fresh set of eyes.
●
Builds better teams.
Clean Application Development – Peer code reviews
Page  25
● Standard and quick solutions to common coding problems
●
Provide standard ways of dealing with common code problems.
●
“Guide to PHP Design Patterns“ by Jason Sweat.
●
“Design Patterns, Elements of Reusable Object-Oriented Software“ by Gang of
four
Clean Application Development – Design Patterns
Page  26
● Frameworks help keep things in line
●
$evil = 'roll-your-own'
●
Knowledge transfer
●
Onboarding
●
Insecure
●
Allows code to be lighter, simpler
●
Does heavy lifting
●
Most modern frameworks are MVC
●
Model – Business logic, Data
●
View – GUI, Presentation
●
Controller – Directs, Commands
●
STICK TO IT!!!
Clean Application Development – Frameworks
Page  27
● We can tell pretty simply this “looks“ like a library. (bookshelves,
computers, book categories)
Clean Application Development – Clear architecture
Page  28
● These are pretty obvious without any explanation.
Clean Application Development – Obvious purpose
Page  29
● This would take a bit more digging to figure out.
Clean Application Development – MVC architecture?
Page  30
● Unit testing = parachute
●
Each test = one thing
●
Ensures system functioning
●
Makes refactoring easier
●
The “Way of Testivus“
Clean Application Development – Testing
Page  31
● Important things should be done first
●
Write failing tests first, then write the code required to make it pass.
Clean Application Development – TDD
Page  32
● QA at the begining instead of the end
●
QA waits for code to test.
●
Create tests based on requirements, first.
●
Developers write code to pass tests.
●
The end is not so bad now.
Clean Application Development – QA and unit tests
Page  33
● Agile = Project Iteration
●
Average sprint is 2 weeks
●
At the end of the sprint EVERYTHING is “done“
●
Tests
●
Development
●
Documentation
●
Velocity charts, MAKE THEM PUBLIC
●
Burn down chart allow business to recover gracefully
Clean Application Development – Agile
Page  34
● Our clients hired a professional, they should get one
●
Professionals are:
●
Trusted
●
Reliable estimates
●
Quality
●
Replaceable
●
Promotable
●
Documented
●
Repeatable
●
Vacation
●
Use standards/conventions
Clean Application Development – Human resources
Page  35
● Clean application development is:
●
Learning, repetition, practice.
●
Clear architecture.
●
Coding standards and styles.
●
Framework and best practices.
●
Testing.
●
Agile.
●
Learning to say “NO“, and defend the code.
●
Living up to the title “Professional“
Clean Application Development – Close
Page  36
● Coming soon!
●
End of year on LeanPub
Clean Application Development – The Book
Clean Application Development
By Adam Culp
https://cleanappdev.com
Page  37
● Resources
●
Adam Culp @adamculp
●
https://joind.in/10797
●
http://www.GeekyBoy.com
●
http://RunGeekRadio.com
●
Book: “Clean Code“ by Robert C. Martin
●
Book: “Refactoring“ by Martin Fowler
●
https://github.com/adamculp/refactoring101
●
Book: “Refactoring 101“ by Adam Culp http://refactoring101.com
●
Book: “Clean Application Development“ by Adam Culp http://cleanappdev.com
●
Book: “Guide to PHP Design Patterns“ by Jason Sweat
●
Book: “Design Patterns“ by Gang of four
●
http://www.php-fig.org
Clean Application Development – Resources
Thank You!

Más contenido relacionado

La actualidad más candente

Agile vs Iterative vs Waterfall models
Agile vs Iterative vs Waterfall models Agile vs Iterative vs Waterfall models
Agile vs Iterative vs Waterfall models Marraju Bollapragada V
 
Zen tao introduction
Zen tao introductionZen tao introduction
Zen tao introductionSpotline mart
 
Agile and Scrum Overview for PMs, Designers and Developers
Agile and Scrum Overview for PMs, Designers and Developers Agile and Scrum Overview for PMs, Designers and Developers
Agile and Scrum Overview for PMs, Designers and Developers Aaron Roy
 
Agile Methodology (scrum)
Agile Methodology (scrum)Agile Methodology (scrum)
Agile Methodology (scrum)Manoj Ellappan
 
Last 2019: Designing a DevOps Dependency Diagram to Decide Development Direction
Last 2019: Designing a DevOps Dependency Diagram to Decide Development DirectionLast 2019: Designing a DevOps Dependency Diagram to Decide Development Direction
Last 2019: Designing a DevOps Dependency Diagram to Decide Development DirectionMark Grebler
 
Introduction to software development methodologies- Agile vs Waterfall
Introduction to software development methodologies- Agile vs WaterfallIntroduction to software development methodologies- Agile vs Waterfall
Introduction to software development methodologies- Agile vs WaterfallPrateek Shrivastava
 
Scrum tools and_meetings
Scrum tools and_meetingsScrum tools and_meetings
Scrum tools and_meetingsAndoni Gonzalo
 
Software Development Methodologies By E2Logy
Software Development Methodologies By E2LogySoftware Development Methodologies By E2Logy
Software Development Methodologies By E2LogyE2LOGY
 
Agile methodology
Agile methodologyAgile methodology
Agile methodologyDhruv Kumar
 
Scrum Primer
Scrum PrimerScrum Primer
Scrum Primerdavelucey
 
Matt Eakin - The New Tester Skillset
Matt Eakin - The New Tester SkillsetMatt Eakin - The New Tester Skillset
Matt Eakin - The New Tester SkillsetQA or the Highway
 
Shift left as first transformation step into Quality Assurance
Shift left as first transformation step into Quality AssuranceShift left as first transformation step into Quality Assurance
Shift left as first transformation step into Quality AssuranceZbyszek Mockun
 

La actualidad más candente (20)

Agile vs Iterative vs Waterfall models
Agile vs Iterative vs Waterfall models Agile vs Iterative vs Waterfall models
Agile vs Iterative vs Waterfall models
 
Scrum overview
Scrum overviewScrum overview
Scrum overview
 
Zen tao introduction
Zen tao introductionZen tao introduction
Zen tao introduction
 
Agile and Scrum Overview for PMs, Designers and Developers
Agile and Scrum Overview for PMs, Designers and Developers Agile and Scrum Overview for PMs, Designers and Developers
Agile and Scrum Overview for PMs, Designers and Developers
 
Agile Methodology (scrum)
Agile Methodology (scrum)Agile Methodology (scrum)
Agile Methodology (scrum)
 
Last 2019: Designing a DevOps Dependency Diagram to Decide Development Direction
Last 2019: Designing a DevOps Dependency Diagram to Decide Development DirectionLast 2019: Designing a DevOps Dependency Diagram to Decide Development Direction
Last 2019: Designing a DevOps Dependency Diagram to Decide Development Direction
 
Introduction to software development methodologies- Agile vs Waterfall
Introduction to software development methodologies- Agile vs WaterfallIntroduction to software development methodologies- Agile vs Waterfall
Introduction to software development methodologies- Agile vs Waterfall
 
Agile Development
Agile DevelopmentAgile Development
Agile Development
 
Scrum tools and_meetings
Scrum tools and_meetingsScrum tools and_meetings
Scrum tools and_meetings
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
 
Presentation on Agile Testing
Presentation on Agile TestingPresentation on Agile Testing
Presentation on Agile Testing
 
Wpm lecture#2
Wpm lecture#2Wpm lecture#2
Wpm lecture#2
 
sdlc
sdlc sdlc
sdlc
 
Software Development Methodologies By E2Logy
Software Development Methodologies By E2LogySoftware Development Methodologies By E2Logy
Software Development Methodologies By E2Logy
 
Agile methodology
Agile methodologyAgile methodology
Agile methodology
 
Scrum Primer
Scrum PrimerScrum Primer
Scrum Primer
 
Matt Eakin - The New Tester Skillset
Matt Eakin - The New Tester SkillsetMatt Eakin - The New Tester Skillset
Matt Eakin - The New Tester Skillset
 
Agile methodology
Agile methodologyAgile methodology
Agile methodology
 
Waterfall model
Waterfall modelWaterfall model
Waterfall model
 
Shift left as first transformation step into Quality Assurance
Shift left as first transformation step into Quality AssuranceShift left as first transformation step into Quality Assurance
Shift left as first transformation step into Quality Assurance
 

Similar a Clean application development (talk)

DrupalGov 2017: Testing any day: guide to end to end test driven Drupal projects
DrupalGov 2017: Testing any day: guide to end to end test driven Drupal projectsDrupalGov 2017: Testing any day: guide to end to end test driven Drupal projects
DrupalGov 2017: Testing any day: guide to end to end test driven Drupal projectsVladimir Roudakov
 
Software Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous InspectionSoftware Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous InspectionJosh Gough
 
Indix Engineering Culture Code (2015)
Indix Engineering Culture Code (2015)Indix Engineering Culture Code (2015)
Indix Engineering Culture Code (2015)Rajesh Muppalla
 
Cynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedCynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedAnna Royzman
 
Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHPRogério Vicente
 
Building Sustainable Software: An Introduction to Software Engineering
Building Sustainable Software: An Introduction to Software EngineeringBuilding Sustainable Software: An Introduction to Software Engineering
Building Sustainable Software: An Introduction to Software EngineeringMuhammad Shehata
 
Why every Tester should also aspire to be a Developer on his project!-Sandee...
Why every Tester should  also aspire to be a Developer on his project!-Sandee...Why every Tester should  also aspire to be a Developer on his project!-Sandee...
Why every Tester should also aspire to be a Developer on his project!-Sandee...bhumika2108
 
Software Development Methodologies
Software Development Methodologies Software Development Methodologies
Software Development Methodologies Frances Coronel
 
presentation about internship project details
presentation about internship project detailspresentation about internship project details
presentation about internship project detailsrajwork2
 
Indy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-muleIndy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-muleikram_ahamed
 
Don't Suck at Building Stuff - Mykel Alvis at Puppet Camp Altanta
Don't Suck at Building Stuff  - Mykel Alvis at Puppet Camp AltantaDon't Suck at Building Stuff  - Mykel Alvis at Puppet Camp Altanta
Don't Suck at Building Stuff - Mykel Alvis at Puppet Camp AltantaPuppet
 
Extreme Programming 1st.pdf
Extreme Programming 1st.pdfExtreme Programming 1st.pdf
Extreme Programming 1st.pdfBassam Kanber
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Vijay Kumbhar
 
Linters for frontend code review
Linters for frontend code reviewLinters for frontend code review
Linters for frontend code reviewVsevolod Nechaev
 
Technical Debt Management
Technical Debt ManagementTechnical Debt Management
Technical Debt ManagementMark Niebergall
 
Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)Peter Kofler
 

Similar a Clean application development (talk) (20)

DrupalGov 2017: Testing any day: guide to end to end test driven Drupal projects
DrupalGov 2017: Testing any day: guide to end to end test driven Drupal projectsDrupalGov 2017: Testing any day: guide to end to end test driven Drupal projects
DrupalGov 2017: Testing any day: guide to end to end test driven Drupal projects
 
Software Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous InspectionSoftware Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous Inspection
 
Indix Engineering Culture Code (2015)
Indix Engineering Culture Code (2015)Indix Engineering Culture Code (2015)
Indix Engineering Culture Code (2015)
 
What is xp
What is xpWhat is xp
What is xp
 
Cynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedCynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not Guaranteed
 
Usable Software Design
Usable Software DesignUsable Software Design
Usable Software Design
 
Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHP
 
Building Sustainable Software: An Introduction to Software Engineering
Building Sustainable Software: An Introduction to Software EngineeringBuilding Sustainable Software: An Introduction to Software Engineering
Building Sustainable Software: An Introduction to Software Engineering
 
Why every Tester should also aspire to be a Developer on his project!-Sandee...
Why every Tester should  also aspire to be a Developer on his project!-Sandee...Why every Tester should  also aspire to be a Developer on his project!-Sandee...
Why every Tester should also aspire to be a Developer on his project!-Sandee...
 
Software Development Methodologies
Software Development Methodologies Software Development Methodologies
Software Development Methodologies
 
presentation about internship project details
presentation about internship project detailspresentation about internship project details
presentation about internship project details
 
Indy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-muleIndy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-mule
 
Don't Suck at Building Stuff - Mykel Alvis at Puppet Camp Altanta
Don't Suck at Building Stuff  - Mykel Alvis at Puppet Camp AltantaDon't Suck at Building Stuff  - Mykel Alvis at Puppet Camp Altanta
Don't Suck at Building Stuff - Mykel Alvis at Puppet Camp Altanta
 
Extreme programming
Extreme programmingExtreme programming
Extreme programming
 
Extreme Programming 1st.pdf
Extreme Programming 1st.pdfExtreme Programming 1st.pdf
Extreme Programming 1st.pdf
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy
 
Pair programming
Pair programmingPair programming
Pair programming
 
Linters for frontend code review
Linters for frontend code reviewLinters for frontend code review
Linters for frontend code review
 
Technical Debt Management
Technical Debt ManagementTechnical Debt Management
Technical Debt Management
 
Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)
 

Más de Adam Culp

Putting legacy to REST with middleware
Putting legacy to REST with middlewarePutting legacy to REST with middleware
Putting legacy to REST with middlewareAdam Culp
 
Release your refactoring superpower
Release your refactoring superpowerRelease your refactoring superpower
Release your refactoring superpowerAdam Culp
 
Managing Technical Debt
Managing Technical DebtManaging Technical Debt
Managing Technical DebtAdam Culp
 
Developing PHP Applications Faster
Developing PHP Applications FasterDeveloping PHP Applications Faster
Developing PHP Applications FasterAdam Culp
 
Containing Quality
Containing QualityContaining Quality
Containing QualityAdam Culp
 
Debugging elephpants
Debugging elephpantsDebugging elephpants
Debugging elephpantsAdam Culp
 
Zend expressive workshop
Zend expressive workshopZend expressive workshop
Zend expressive workshopAdam Culp
 
Expressive Microservice Framework Blastoff
Expressive Microservice Framework BlastoffExpressive Microservice Framework Blastoff
Expressive Microservice Framework BlastoffAdam Culp
 
Foundations of Zend Framework
Foundations of Zend FrameworkFoundations of Zend Framework
Foundations of Zend FrameworkAdam Culp
 
Accidental professional
Accidental professionalAccidental professional
Accidental professionalAdam Culp
 
Build great products
Build great productsBuild great products
Build great productsAdam Culp
 
Does Your Code Measure Up?
Does Your Code Measure Up?Does Your Code Measure Up?
Does Your Code Measure Up?Adam Culp
 
Practical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsAdam Culp
 
Virtualizing Development
Virtualizing DevelopmentVirtualizing Development
Virtualizing DevelopmentAdam Culp
 
Refactoring Legacy Code
Refactoring Legacy CodeRefactoring Legacy Code
Refactoring Legacy CodeAdam Culp
 
Deprecated: Foundations of Zend Framework 2
Deprecated: Foundations of Zend Framework 2Deprecated: Foundations of Zend Framework 2
Deprecated: Foundations of Zend Framework 2Adam Culp
 
Refactoring 101
Refactoring 101Refactoring 101
Refactoring 101Adam Culp
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAdam Culp
 

Más de Adam Culp (20)

Hypermedia
HypermediaHypermedia
Hypermedia
 
Putting legacy to REST with middleware
Putting legacy to REST with middlewarePutting legacy to REST with middleware
Putting legacy to REST with middleware
 
php-1701-a
php-1701-aphp-1701-a
php-1701-a
 
Release your refactoring superpower
Release your refactoring superpowerRelease your refactoring superpower
Release your refactoring superpower
 
Managing Technical Debt
Managing Technical DebtManaging Technical Debt
Managing Technical Debt
 
Developing PHP Applications Faster
Developing PHP Applications FasterDeveloping PHP Applications Faster
Developing PHP Applications Faster
 
Containing Quality
Containing QualityContaining Quality
Containing Quality
 
Debugging elephpants
Debugging elephpantsDebugging elephpants
Debugging elephpants
 
Zend expressive workshop
Zend expressive workshopZend expressive workshop
Zend expressive workshop
 
Expressive Microservice Framework Blastoff
Expressive Microservice Framework BlastoffExpressive Microservice Framework Blastoff
Expressive Microservice Framework Blastoff
 
Foundations of Zend Framework
Foundations of Zend FrameworkFoundations of Zend Framework
Foundations of Zend Framework
 
Accidental professional
Accidental professionalAccidental professional
Accidental professional
 
Build great products
Build great productsBuild great products
Build great products
 
Does Your Code Measure Up?
Does Your Code Measure Up?Does Your Code Measure Up?
Does Your Code Measure Up?
 
Practical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with Jenkins
 
Virtualizing Development
Virtualizing DevelopmentVirtualizing Development
Virtualizing Development
 
Refactoring Legacy Code
Refactoring Legacy CodeRefactoring Legacy Code
Refactoring Legacy Code
 
Deprecated: Foundations of Zend Framework 2
Deprecated: Foundations of Zend Framework 2Deprecated: Foundations of Zend Framework 2
Deprecated: Foundations of Zend Framework 2
 
Refactoring 101
Refactoring 101Refactoring 101
Refactoring 101
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 

Último

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 

Último (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 

Clean application development (talk)

  • 2. Page  2 ● About Me ● PHP 5.3 Certified ● Consultant at Zend Technologies ● Organizer – SoFloPHP (South Florida) ● Organized – SunshinePHP (Miami) ● Long distance (ultra) runner ● Judo Black Belt Instructor Clean Application Development – About Me
  • 3. Page  3 ● I love iteration! ● Evolution. ● Learning to walk. ● Training to run. ● Evading project managers. ● Clean development. Clean Application Development – Iteration
  • 4. Page  4 ● Clean application development cannot be taught in 45 minutes ● Practice, Practice, Practice. ● Leave the code better than you found it. ● Always watch for new techniques. ● No “silver bullet“. Clean Application Development – Learning
  • 5. Page  5 ● A great resource on code quality. Clean Application Development – Resources Clean Code By Robert C. Martin
  • 6. Page  6 ● Disasters happen, resulting in bad code... ● It's easy ● Short deadlines ● Boss ● Laziness ● Lack of “how-to“ ● Come back and clean later ● We are the cause! Clean Application Development – Causes of bad code
  • 7. Page  7 ● Bad code starts innocently ● Hire a new professional/developer ● Clean slate, no expectations ● Start a new project ● Initial code output is quick and easy, setting expectation ● Slows down over time ● Complexity increases ● Domino effect Clean Application Development – Typical Scenario
  • 8. Page  8 ● Our responsibility to say “NO“ ● Managers job = defend schedule and features ● Our job = defend the code ● Managers respect realistic reasons and explanations Clean Application Development – Defend the code
  • 9. Page  9 ● Others judge us on our code ● We are @authors. ● 75% of time reading code ● Others read our code also ● And they talk about it! ● How developers talk about us = “CRED“ Clean Application Development – We are judged And they talk about it!
  • 10. Page  10 ● Side-effects of bad code: ● Wasted Time ● Bugs ● Excessive debugging ● Procrastination ● Missed deadlines ● Technical debt ● Financial losses Clean Application Development – Result of bad code
  • 11. Page  11 ● How we typically react to a dirty application: ● Padded estimates ● Developers Hide ● Become defensive ● Blame others/requirements ● Add developers ● Rewrite! Clean Application Development – The aftermath
  • 12. Page  12 ● The problem with a rewrite: ● Development team split, old/new ● Legacy application enhanced ● New application Scope creep ● Is it done yet? ● Ends with more bad code! Clean Application Development – Rewrite problems
  • 13. Page  13 ● Learn to Refactor. Clean Application Development – Resources Refactoring 101 By Adam Culp Refactoring By Martin Fowler https://github.com/adamculp/refactoring101 https://refactoring101.com
  • 14. Page  14 ● With all of these problems, clean applications makes sense ● Shortens development time. ● On-boarding of developers easier. ● Less bugs. ● Happier end-users. ● Predictable schedules. ● It's the professional thing to do. Clean Application Development – Common sense
  • 15. Page  15 ● Coding Standards save time ● Gives direction ● PHP Framework Interoperability Group (https://www.php-fig.org). ● PSR-0 Autoloading Standard ● PSR-1 Basic Coding Standard ● PSR-2 Coding Style Guide ● PSR-3 Logging ● PSR-4 Improved Autoloading ● Standard NOT important ● Choose one ● Stick with it ● Consistency is key Clean Application Development – Coding standards
  • 16. Page  16 ● Names should be clear ● Functions and variables should tell a story. Clean Application Development – Clear names $elapsedTimeInDays; $daysSinceCreation; $daysSinceModified; $fileAgeInDays; $elapsed; $createdDays; $modifiedDays; $age; GoodBad
  • 17. Page  17 ● Shy away from variations of the same name ● To ensure names are different enough to portray difference. Clean Application Development – No confusion $product $productInfo $productData $productDescription What is the difference between these?
  • 18. Page  18 ● Certain characters are hard to understand Clean Application Development – Bad characters Lower case L Uppercase O (oh) Uppercase I (eye) Bad
  • 19. Page  19 ● Technical names help developers who actually read the code. ● Non-technical terms for client documentation. ● Class names should be nouns ● Describe. ● Ex. - Customer, Account, Product, Company. ● Method names should be verbs ● Action. ● Ex. - getCustomer, closeAccount, updateProduct, addCompany. ● Pick a set of keywords and stick with them. ● Ex. - fetch, get, add, update, remove, delete Clean Application Development – Name grammar
  • 20. Page  20 ● More on Clean Code ● Functions: ● Short ● Single purpose ● As expected ● Well named ● Recognizing bad doesn't mean we know how to make good ● We know a good/bad song, but are not song writers ● Clean code = caring developer ● Does not require many comments Clean Application Development – Clean code
  • 21. Page  21 ● Comments can also be a bad “smell“ ● Comments are often used to cover up bad code. ● Code should be self-documenting Clean Application Development – Code comments
  • 22. Page  22 ● How to spot bad code (smells) ● Incomplete error handling ● Memory leaks ● Race conditions ● Inconsistent naming convention (class, function, variable) ● Inconsistent coding standard ● Un-initialized variables ● Code lacks clear purpose ● Functions do too much (more than one thing) ● Globals used ● Too many comments in the code ● Notices, Warnings, Fatal Errors Clean Application Development – Smells of bad code
  • 23. Page  23 ● Let PHP CodeSniffer detect bad smells ● Set rules to detect if coding standard is not followed ● Run during commits in version control ● PhpStorm integration Clean Application Development – Code sniffer
  • 24. Page  24 ● Peer code review great learning tool ● Peers help train each other on strong points. ● Fresh set of eyes. ● Builds better teams. Clean Application Development – Peer code reviews
  • 25. Page  25 ● Standard and quick solutions to common coding problems ● Provide standard ways of dealing with common code problems. ● “Guide to PHP Design Patterns“ by Jason Sweat. ● “Design Patterns, Elements of Reusable Object-Oriented Software“ by Gang of four Clean Application Development – Design Patterns
  • 26. Page  26 ● Frameworks help keep things in line ● $evil = 'roll-your-own' ● Knowledge transfer ● Onboarding ● Insecure ● Allows code to be lighter, simpler ● Does heavy lifting ● Most modern frameworks are MVC ● Model – Business logic, Data ● View – GUI, Presentation ● Controller – Directs, Commands ● STICK TO IT!!! Clean Application Development – Frameworks
  • 27. Page  27 ● We can tell pretty simply this “looks“ like a library. (bookshelves, computers, book categories) Clean Application Development – Clear architecture
  • 28. Page  28 ● These are pretty obvious without any explanation. Clean Application Development – Obvious purpose
  • 29. Page  29 ● This would take a bit more digging to figure out. Clean Application Development – MVC architecture?
  • 30. Page  30 ● Unit testing = parachute ● Each test = one thing ● Ensures system functioning ● Makes refactoring easier ● The “Way of Testivus“ Clean Application Development – Testing
  • 31. Page  31 ● Important things should be done first ● Write failing tests first, then write the code required to make it pass. Clean Application Development – TDD
  • 32. Page  32 ● QA at the begining instead of the end ● QA waits for code to test. ● Create tests based on requirements, first. ● Developers write code to pass tests. ● The end is not so bad now. Clean Application Development – QA and unit tests
  • 33. Page  33 ● Agile = Project Iteration ● Average sprint is 2 weeks ● At the end of the sprint EVERYTHING is “done“ ● Tests ● Development ● Documentation ● Velocity charts, MAKE THEM PUBLIC ● Burn down chart allow business to recover gracefully Clean Application Development – Agile
  • 34. Page  34 ● Our clients hired a professional, they should get one ● Professionals are: ● Trusted ● Reliable estimates ● Quality ● Replaceable ● Promotable ● Documented ● Repeatable ● Vacation ● Use standards/conventions Clean Application Development – Human resources
  • 35. Page  35 ● Clean application development is: ● Learning, repetition, practice. ● Clear architecture. ● Coding standards and styles. ● Framework and best practices. ● Testing. ● Agile. ● Learning to say “NO“, and defend the code. ● Living up to the title “Professional“ Clean Application Development – Close
  • 36. Page  36 ● Coming soon! ● End of year on LeanPub Clean Application Development – The Book Clean Application Development By Adam Culp https://cleanappdev.com
  • 37. Page  37 ● Resources ● Adam Culp @adamculp ● https://joind.in/10797 ● http://www.GeekyBoy.com ● http://RunGeekRadio.com ● Book: “Clean Code“ by Robert C. Martin ● Book: “Refactoring“ by Martin Fowler ● https://github.com/adamculp/refactoring101 ● Book: “Refactoring 101“ by Adam Culp http://refactoring101.com ● Book: “Clean Application Development“ by Adam Culp http://cleanappdev.com ● Book: “Guide to PHP Design Patterns“ by Jason Sweat ● Book: “Design Patterns“ by Gang of four ● http://www.php-fig.org Clean Application Development – Resources Thank You!