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
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
480
Why TDD is a dangerous sect
sharnik
4
310
Other Decks in Programming
See All in Programming
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
5
1.9k
仕様駆動開発の消費期限
watany
20
8.7k
数百円から始めるRuby電子工作
tarosay
0
170
5分で問診!Composer セキュリティ健康診断
codmoninc
0
1.1k
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
330
yield再入門 #phpcon
o0h
PRO
0
1.2k
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
700
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
430
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
230
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
180
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
230
Foundation Models frameworkで画像分析
ryodeveloper
1
630
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
960
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
420
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
270
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
We Have a Design System, Now What?
morganepeng
55
8.3k
Crafting Experiences
bethany
1
250
The browser strikes back
jonoalderson
0
1.5k
A Soul's Torment
seathinner
6
3.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
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