Let’s Debug For Real!
Part 2 in the “Braver, Faster, Better” series
that I just made up
Who Are You?
Any or all of the following:
- Theme author
- Plugin developer
- Just curious how WordPress works
What is a debugger and why do I need one?
(for today, mostly PHP)
Why: to achieve zen-like calm
A debugger is software that lets you closely inspect what's happening in other software in real-time.
It helps you find bugs and get rid of them.
Without a debugger
With a debugger
- All of the above plus:
- Pause (and continue) execution at any point
- Step through code by lines or chunks
- See all currently defined variables
- Inspect the value of any variable (over time)
- Overall: much less guessing
- Step [Into/Out/Over]
- Call Stack
Browser Extensions (optional)
Make the IDE ⟷ XDebug connection easier
A good IDE is very, very good
Why an IDE is nice
- Fabulous code completion
- Mistake avoidance (warnings, inspections)
- Full project navigation (go to X)
- Help when refactoring
Or: manual (php.ini)
- Version control
- Really remote debugging
- Testing frameworks
Questions, Comments, Answers, or Problems?