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
440
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
190
Going Polyglot the Easy Way
sharnik
0
430
Why TDD is a dangerous sect
sharnik
4
300
Other Decks in Programming
See All in Programming
Ruby's Line Breaks
yui_knk
4
2.8k
スモールスタートで始めるためのLambda×モノリス(Lambdalith)
akihisaikeda
2
340
Cline with Amazon Bedrockで爆速開発体験ハンズオン/ 株式会社ブリューアス登壇資料
mhan
0
110
Dissecting and Reconstructing Ruby Syntactic Structures
ydah
3
2k
RubyKaigi Dev Meeting 2025
tenderlove
1
1.3k
Golangci-lint v2爆誕: 君たちはどうすべきか
logica0419
1
230
AIコーディングエージェントを 「使いこなす」ための実践知と現在地 in ログラス / How to Use AI Coding Agent in Loglass
rkaga
4
1.2k
ComposeでのPicture in Picture
takathemax
0
130
Laravel × Clean Architecture
bumptakayuki
PRO
0
130
音声プラットフォームのアーキテクチャ変遷から学ぶ、クラウドネイティブなバッチ処理 (20250422_CNDS2025_Batch_Architecture)
thousanda
0
380
Instrumentsを使用した アプリのパフォーマンス向上方法
hinakko
0
230
flutter_kaigi_mini_4.pdf
nobu74658
0
140
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
3.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
Making Projects Easy
brettharned
116
6.2k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
A Tale of Four Properties
chriscoyier
158
23k
4 Signs Your Business is Dying
shpigford
183
22k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
780
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Done Done
chrislema
184
16k
What's in a price? How to price your products and services
michaelherold
245
12k
Code Review Best Practice
trishagee
67
18k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
820
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