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
410
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
180
Going Polyglot the Easy Way
sharnik
0
410
Why TDD is a dangerous sect
sharnik
4
290
Other Decks in Programming
See All in Programming
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
3
1.1k
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
Recoilを剥がしている話
kirik
5
6.6k
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
270
Haze - Real time background blurring
chrisbanes
1
510
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
200
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
770
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
900
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
A Philosophy of Restraint
colly
203
16k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
Statistics for Hackers
jakevdp
796
220k
Rails Girls Zürich Keynote
gr2m
94
13k
Visualization
eitanlees
146
15k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
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