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
470
0
Share
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
220
Going Polyglot the Easy Way
sharnik
0
460
Why TDD is a dangerous sect
sharnik
4
310
Other Decks in Programming
See All in Programming
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
280
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
210
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
270
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
170
Liberating Ruby's Parser from Lexer Hacks
ydah
2
1.7k
JOAI2026 1st solution - heron0519 -
heron0519
0
140
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
580
The Less-Told Story of Socket Timeouts
coe401_
3
470
おれのAgentic Coding 2026/03
tsukasagr
1
150
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
190
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
3
340
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
150
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
My Coaching Mixtape
mlcsv
0
100
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Test your architecture with Archunit
thirion
1
2.2k
Into the Great Unknown - MozCon
thekraken
41
2.4k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
150
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Navigating Team Friction
lara
192
16k
Bash Introduction
62gerente
615
210k
The Pragmatic Product Professional
lauravandoore
37
7.2k
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