Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Debugging
Search
sharnik
June 17, 2015
Programming
0
460
Debugging
Presentation about debugging for people just learning to program.
sharnik
June 17, 2015
Tweet
Share
More Decks by sharnik
See All by sharnik
Cross-platform Mobile Development with React Native
sharnik
0
210
Going Polyglot the Easy Way
sharnik
0
450
Why TDD is a dangerous sect
sharnik
4
300
Other Decks in Programming
See All in Programming
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
580
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
250
AtCoder Conference 2025
shindannin
0
850
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
620
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
290
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
130
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
560
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
300
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
150
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
2k
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
150
Patterns of Patterns
denyspoltorak
0
400
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Rails Girls Zürich Keynote
gr2m
95
14k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
860
How GitHub (no longer) Works
holman
316
140k
Designing for Timeless Needs
cassininazir
0
110
Claude Code のすすめ
schroneko
67
210k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
180
Transcript
Wojciech @sharnik haikuco.de
Programming is like riding a bike.
Except the bike is on fire and you're on fire
and everything is on fire and you're actually in hell.
None
Main programming tasks: » Adding bugs » Removing bugs
Debugging
Know what you're trying to do
Inputs -> Program -> Outputs Calculator.add(2, 3) # => 5
Workflow
Reproduce the error
Make a hypothesis
Fix
Profit
If that didn't help, rollback
Techniques
Puts debugging class Calculator def add(a, b) puts a puts
b a + b end end result = Calculator.new.add(2, 3) puts result
strings vs numbers ruby -e "x = 3; puts x"
# => 3 ruby -e "x = '3'; puts x" # => 3 ruby -e "x = 3; puts x.inspect" # => 3 ruby -e "x = '3'; puts x.inspect" # => "3"
p: shorter puts X.inspect class Calculator def add(a, b) p
a p b a + b end end result = Calculator.new.add(2, 3) p result
debugger: pry + byebug require 'pry-byebug' class Calculator def add(a,
b) binding.pry a + b end end Calculator.new.add(2, 3)
Strategies
"Wolf fence" algorithm
Rubber duck debugging
Practice
Exercise gist.github.com/sharnik/2aedd681e6bcf81a7697 Remember » understand expectations » pinpoint where the
bug is » find what the bug is » fix it