Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
Transcript
24 slides
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
More Decks by sharnik
See All by sharnik
Cross-platform Mobile Development with React Native
sharnik
0
240
Going Polyglot the Easy Way
sharnik
0
490
Why TDD is a dangerous sect
sharnik
4
320
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
260
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
750
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
430
Next.js: The final boss of Web Performance
guaca
0
400
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
130
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
310
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
370
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
190
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
11k
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
840
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2.3k
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
330
Featured
See All Featured
How to Ace a Technical Interview
jacobian
280
24k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
630
The Pragmatic Product Professional
lauravandoore
37
7.5k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
440
Optimizing for Happiness
mojombo
378
71k
The SEO Collaboration Effect
kristinabergwall1
1
620
Paper Plane
katiecoart
PRO
6
55k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
460
Art, The Web, and Tiny UX
lynnandtonic
304
22k
30 Presentation Tips
portentint
PRO
1
470
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
610
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k