Getting yourself out of trouble with anti-patterns
summary
Shows concrete fixes and tools for real PHP disasters: running copy-paste detector via Composer finds 35 clones and ~2,000 duplicated files, refactoring with a Template Method removes 450 lines and four clone groups; using git blame/log uncovers lava‑flow churn and duplicate commits so methods get rationalized to version1/version2; a broken DB helper opens 40–50 connections per page and is fixed by a config object plus connection reuse; large report blob splits into query‑builder, temporary‑table and metrics classes and becomes testable.
AI-written summary · about
chapters (20)
- 0:00Start
- 2:12Design Patterns
- 3:42Spotting Anti Patterns
- 5:21Symptoms of Cut and Paste Programming
- 7:32Copy-Paste Detector
- 8:58Pluck Reusable Components
- 11:35Code Review
- 12:10Lava Flow
- 20:43Code Is a Mess
- 21:09Symptoms of the Spaghetti Code
- 22:47Commit Messages
- 25:44Database Connection Script
- 27:57Encapsulating Stuff with Getters and Setters
- 36:45Identify Relationships According to the Contracts
- 39:43Removing Couplings
- 40:28Remove the Coupling
- 45:07Project Management Antipatterns
- 46:59Declare Success at the End of the Project
- 47:56Fire Drill
- 49:02Final Notes
related talks
33mCode Archaeology: Becoming Indiana Jones
01h 47mClean code
41mTesting Legacy Code & Safe Refactoring
45mCoding Horrors - A Horror Film Fan's Guide to PHP Coding Nightmares
39mSeveral years of SOLID-aware development
32mKeeping your code strong
40mRefactoring Huge Legacy PHP Applications - From 100 hours to minutes
46mLiving the best life on a legacy project
