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
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
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
2
260
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.4k
Press start. Python's next generation.
willingc
PRO
3
300
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
140
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
260
Hono + Inertia + React で LP を構築した話
oukayuka
2
200
FDEとは、何者なのか?
masapyon1212
0
130
Flow は今どうなっているか
mizdra
PRO
0
870
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
540
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.6k
ALB ログから Trace を気合で繋げる技術
fohte
7
860
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
160
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
630
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
180
Mobile First: as difficult as doing things right
swwweet
225
10k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
640
Building Flexible Design Systems
yeseniaperezcruz
330
41k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
460
Discover your Explorer Soul
emna__ayadi
2
1.3k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Building an army of robots
kneath
306
46k
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