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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
sharnik
June 17, 2015
Programming
480
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Debugging
Presentation about debugging for people just learning to program.
sharnik
June 17, 2015
More Decks by sharnik
See All by sharnik
Cross-platform Mobile Development with React Native
sharnik
0
230
Going Polyglot the Easy Way
sharnik
0
470
Why TDD is a dangerous sect
sharnik
4
310
Other Decks in Programming
See All in Programming
Lessons from Spec-Driven Development
simas
PRO
0
230
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
180
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
900
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
210
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
620
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.5k
symfony/aiとlaravel/boost
77web
0
100
どこまでゆるくて許されるのか
tk3fftk
0
280
はてなアカウント基盤 State of the Union
cockscomb
1
1.1k
Performance Engineering for Everyone
elenatanasoiu
0
240
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7.1k
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
130
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
830
Believing is Seeing
oripsolob
1
160
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
450
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
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