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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
sharnik
June 17, 2015
Programming
0
470
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
210
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
AgentCoreとHuman in the Loop
har1101
5
260
AIに仕事を丸投げしたら、本当に楽になれるのか
dip_tech
PRO
0
110
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
160
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
190
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
200
JPUG勉強会 OSSデータベースの内部構造を理解しよう
oga5
1
150
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
CSC307 Lecture 04
javiergs
PRO
0
660
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
280
Package Management Learnings from Homebrew
mikemcquaid
0
240
Python’s True Superpower
hynek
0
150
Raku Raku Notion 20260128
hareyakayuruyaka
0
390
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Accessibility Awareness
sabderemane
0
62
AI: The stuff that nobody shows you
jnunemaker
PRO
2
280
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
740
First, design no harm
axbom
PRO
2
1.1k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
260
Paper Plane (Part 1)
katiecoart
PRO
0
4.4k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
320
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.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