SlideShare a Scribd company logo
1 of 16
tap>: a simple debugging
function
Laurence Chen
Medium Blog: @replware
Clojure video tutorial
https://lambdaisland.com/
Agenda
● General ideas of debug
○ How most people debug
○ Scientific methods of debugging
● Problems with `print`
○ `print` conflates what to observe and how to observe
○ split the concerns
○ `tap>` is language agnostic idea
Many people debug like this
● Jump to the conclusion
● Change multiple things at a time, and test it
● Give up and call for help
Scientific method
Debugging tips x 1
● Reproduce the bug (Experiment)
● Change one thing at a time (Experiement)
● Read the manual and test files (Observation)
Debugging tips x 2
● Ask yourself “Which hypothesis will be verified by the
experiments that you plan to do?”
● As for hypothesis: combined it with rubber duck debugging
method
● Write it down
rubber duck debugging
● Explain every line of code to a duck
● Let the back ground process work
Problems with `print`
● When we need to output a time to log, which format is best?
○ timestamp
○ ISO-8601
● When certain data has 4 layers of nesting structure, how to
output it to log?
`print` conflates what to observe and how to observe
Exception handling: Doing too much
Exception handling: Delegate the rights to the caller
tap> example
● @debug
● ;;=> [(2 3 4)]
● @debug2
● ;; 2
Three typical ways to using tap>
● Record all the values sent in an atom --- previous code sample
● Record the last value in an atom
(def debug (atom nil))
(add-tap #(reset! debug %))
● Connect directly to different print functions
(add-tap (bound-fn* prn))
How to implement tap>
● A queue to hold tap values
● A dedicated thread for running all the handlers
● A mechanism to register and unregister the handler
tap> is a language agnostic idea
Reference
● Debugging with the Scientific Method --- Stuart Halloway
● Making reliable distributed systems in the presence of software
errors --- Joe Armstrong

More Related Content

What's hot

Engineering Efficiency in LINE
Engineering Efficiency in LINEEngineering Efficiency in LINE
Engineering Efficiency in LINEHuy Do
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpcFan Robbin
 
Computer network (8)
Computer network (8)Computer network (8)
Computer network (8)NYversity
 
Introducing TDD
Introducing TDDIntroducing TDD
Introducing TDDVlad Balan
 
Programming Sessions KU Leuven - Session 02
Programming Sessions KU Leuven - Session 02Programming Sessions KU Leuven - Session 02
Programming Sessions KU Leuven - Session 02Rafael Camacho Dejay
 
Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Koombea
 
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)Igalia
 
Static Code Analysis and AutoLint
Static Code Analysis and AutoLintStatic Code Analysis and AutoLint
Static Code Analysis and AutoLintLeander Hasty
 
Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012slandelle
 
Assignment 1-mtat
Assignment 1-mtatAssignment 1-mtat
Assignment 1-mtatzafargilani
 
Golang 101
Golang 101Golang 101
Golang 101宇 傅
 
Dangers of parallel streams
Dangers of parallel streamsDangers of parallel streams
Dangers of parallel streamsLukáš Křečan
 
Go lang introduction
Go lang introductionGo lang introduction
Go lang introductionyangwm
 
Asyncio : Final frontier in python
Asyncio : Final frontier in pythonAsyncio : Final frontier in python
Asyncio : Final frontier in pythonAnkit Mittal
 
Automata based-programming
Automata based-programmingAutomata based-programming
Automata based-programmingShaheer Ahmed
 

What's hot (20)

Engineering Efficiency in LINE
Engineering Efficiency in LINEEngineering Efficiency in LINE
Engineering Efficiency in LINE
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
 
Computer network (8)
Computer network (8)Computer network (8)
Computer network (8)
 
overview of c#
overview of c#overview of c#
overview of c#
 
Introducing TDD
Introducing TDDIntroducing TDD
Introducing TDD
 
ZeroMQ with NodeJS
ZeroMQ with NodeJSZeroMQ with NodeJS
ZeroMQ with NodeJS
 
Programming Sessions KU Leuven - Session 02
Programming Sessions KU Leuven - Session 02Programming Sessions KU Leuven - Session 02
Programming Sessions KU Leuven - Session 02
 
Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?
 
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
 
Static Code Analysis and AutoLint
Static Code Analysis and AutoLintStatic Code Analysis and AutoLint
Static Code Analysis and AutoLint
 
Golang
GolangGolang
Golang
 
Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012
 
Assignment 1-mtat
Assignment 1-mtatAssignment 1-mtat
Assignment 1-mtat
 
Golang 101
Golang 101Golang 101
Golang 101
 
Dangers of parallel streams
Dangers of parallel streamsDangers of parallel streams
Dangers of parallel streams
 
Go lang introduction
Go lang introductionGo lang introduction
Go lang introduction
 
Asyncio : Final frontier in python
Asyncio : Final frontier in pythonAsyncio : Final frontier in python
Asyncio : Final frontier in python
 
Dynamic scoping
Dynamic scopingDynamic scoping
Dynamic scoping
 
Python lecture 02
Python lecture 02Python lecture 02
Python lecture 02
 
Automata based-programming
Automata based-programmingAutomata based-programming
Automata based-programming
 

Similar to A simple tool for debug (tap>)

What Your Tech Lead Thinks You Know (But Didn't Teach You)
What Your Tech Lead Thinks You Know (But Didn't Teach You)What Your Tech Lead Thinks You Know (But Didn't Teach You)
What Your Tech Lead Thinks You Know (But Didn't Teach You)Chris Riccomini
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughgabriellekuruvilla
 
python presentation
python presentationpython presentation
python presentationVaibhavMawal
 
Write unit test from scratch
Write unit test from scratchWrite unit test from scratch
Write unit test from scratchWen-Shih Chao
 
Stripe CTF3 wrap-up
Stripe CTF3 wrap-upStripe CTF3 wrap-up
Stripe CTF3 wrap-upStripe
 
Practical SystemTAP basics: Perl memory profiling
Practical SystemTAP basics: Perl memory profilingPractical SystemTAP basics: Perl memory profiling
Practical SystemTAP basics: Perl memory profilingLubomir Rintel
 
Bsdtw17: theo de raadt: mitigations and other real security features
Bsdtw17: theo de raadt: mitigations and other real security featuresBsdtw17: theo de raadt: mitigations and other real security features
Bsdtw17: theo de raadt: mitigations and other real security featuresScott Tsai
 
PyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development UpdatedPyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development UpdatedAlessandro Molina
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonmckennadglyn
 
Application development with Python - Desktop application
Application development with Python - Desktop applicationApplication development with Python - Desktop application
Application development with Python - Desktop applicationBao Long Nguyen Dang
 
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Igalia
 
Number of Computer Languages = 3
Number of Computer Languages = 3Number of Computer Languages = 3
Number of Computer Languages = 3Ram Sekhar
 
Low latency Logging (BrightonPHP - 18th Nov 2013)
Low latency Logging (BrightonPHP - 18th Nov 2013)Low latency Logging (BrightonPHP - 18th Nov 2013)
Low latency Logging (BrightonPHP - 18th Nov 2013)James Titcumb
 
LCE12: Intro Training: Upstreaming 101
LCE12: Intro Training: Upstreaming 101LCE12: Intro Training: Upstreaming 101
LCE12: Intro Training: Upstreaming 101Linaro
 
Mastering Python lesson 3a
Mastering Python lesson 3aMastering Python lesson 3a
Mastering Python lesson 3aRuth Marvin
 
Php Inspections (EA Extended): The Cookbook
Php Inspections (EA Extended): The CookbookPhp Inspections (EA Extended): The Cookbook
Php Inspections (EA Extended): The CookbookVladimir Reznichenko
 
Logika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanLogika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanArif Huda
 

Similar to A simple tool for debug (tap>) (20)

What Your Tech Lead Thinks You Know (But Didn't Teach You)
What Your Tech Lead Thinks You Know (But Didn't Teach You)What Your Tech Lead Thinks You Know (But Didn't Teach You)
What Your Tech Lead Thinks You Know (But Didn't Teach You)
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
python presentation
python presentationpython presentation
python presentation
 
U3 l4 using simple commands
U3 l4 using simple commandsU3 l4 using simple commands
U3 l4 using simple commands
 
Write unit test from scratch
Write unit test from scratchWrite unit test from scratch
Write unit test from scratch
 
Stripe CTF3 wrap-up
Stripe CTF3 wrap-upStripe CTF3 wrap-up
Stripe CTF3 wrap-up
 
Practical SystemTAP basics: Perl memory profiling
Practical SystemTAP basics: Perl memory profilingPractical SystemTAP basics: Perl memory profiling
Practical SystemTAP basics: Perl memory profiling
 
Bsdtw17: theo de raadt: mitigations and other real security features
Bsdtw17: theo de raadt: mitigations and other real security featuresBsdtw17: theo de raadt: mitigations and other real security features
Bsdtw17: theo de raadt: mitigations and other real security features
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
PyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development UpdatedPyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development Updated
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Application development with Python - Desktop application
Application development with Python - Desktop applicationApplication development with Python - Desktop application
Application development with Python - Desktop application
 
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
 
Number of Computer Languages = 3
Number of Computer Languages = 3Number of Computer Languages = 3
Number of Computer Languages = 3
 
Low latency Logging (BrightonPHP - 18th Nov 2013)
Low latency Logging (BrightonPHP - 18th Nov 2013)Low latency Logging (BrightonPHP - 18th Nov 2013)
Low latency Logging (BrightonPHP - 18th Nov 2013)
 
LCE12: Intro Training: Upstreaming 101
LCE12: Intro Training: Upstreaming 101LCE12: Intro Training: Upstreaming 101
LCE12: Intro Training: Upstreaming 101
 
Mastering Python lesson 3a
Mastering Python lesson 3aMastering Python lesson 3a
Mastering Python lesson 3a
 
Python lecture 01
Python lecture 01Python lecture 01
Python lecture 01
 
Php Inspections (EA Extended): The Cookbook
Php Inspections (EA Extended): The CookbookPhp Inspections (EA Extended): The Cookbook
Php Inspections (EA Extended): The Cookbook
 
Logika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanLogika dan Algoritma pemrograman
Logika dan Algoritma pemrograman
 

More from Laurence Chen

The obstacles of developer productivity.pptx
The obstacles of developer productivity.pptxThe obstacles of developer productivity.pptx
The obstacles of developer productivity.pptxLaurence Chen
 
Schema, validation and generative testing
Schema, validation and generative testingSchema, validation and generative testing
Schema, validation and generative testingLaurence Chen
 
The immutable database datomic
The immutable database   datomicThe immutable database   datomic
The immutable database datomicLaurence Chen
 
The productivity brought by Clojure
The productivity brought by ClojureThe productivity brought by Clojure
The productivity brought by ClojureLaurence Chen
 

More from Laurence Chen (6)

Create your library
Create your libraryCreate your library
Create your library
 
on log messages
on log messageson log messages
on log messages
 
The obstacles of developer productivity.pptx
The obstacles of developer productivity.pptxThe obstacles of developer productivity.pptx
The obstacles of developer productivity.pptx
 
Schema, validation and generative testing
Schema, validation and generative testingSchema, validation and generative testing
Schema, validation and generative testing
 
The immutable database datomic
The immutable database   datomicThe immutable database   datomic
The immutable database datomic
 
The productivity brought by Clojure
The productivity brought by ClojureThe productivity brought by Clojure
The productivity brought by Clojure
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

A simple tool for debug (tap>)

  • 1. tap>: a simple debugging function Laurence Chen Medium Blog: @replware Clojure video tutorial https://lambdaisland.com/
  • 2. Agenda ● General ideas of debug ○ How most people debug ○ Scientific methods of debugging ● Problems with `print` ○ `print` conflates what to observe and how to observe ○ split the concerns ○ `tap>` is language agnostic idea
  • 3. Many people debug like this ● Jump to the conclusion ● Change multiple things at a time, and test it ● Give up and call for help
  • 5. Debugging tips x 1 ● Reproduce the bug (Experiment) ● Change one thing at a time (Experiement) ● Read the manual and test files (Observation)
  • 6. Debugging tips x 2 ● Ask yourself “Which hypothesis will be verified by the experiments that you plan to do?” ● As for hypothesis: combined it with rubber duck debugging method ● Write it down
  • 7. rubber duck debugging ● Explain every line of code to a duck ● Let the back ground process work
  • 8. Problems with `print` ● When we need to output a time to log, which format is best? ○ timestamp ○ ISO-8601 ● When certain data has 4 layers of nesting structure, how to output it to log?
  • 9. `print` conflates what to observe and how to observe
  • 11. Exception handling: Delegate the rights to the caller
  • 12. tap> example ● @debug ● ;;=> [(2 3 4)] ● @debug2 ● ;; 2
  • 13. Three typical ways to using tap> ● Record all the values sent in an atom --- previous code sample ● Record the last value in an atom (def debug (atom nil)) (add-tap #(reset! debug %)) ● Connect directly to different print functions (add-tap (bound-fn* prn))
  • 14. How to implement tap> ● A queue to hold tap values ● A dedicated thread for running all the handlers ● A mechanism to register and unregister the handler
  • 15. tap> is a language agnostic idea
  • 16. Reference ● Debugging with the Scientific Method --- Stuart Halloway ● Making reliable distributed systems in the presence of software errors --- Joe Armstrong