Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pry-byebug with ruby debug in generated Gemfile #399

Open
eoinkelly opened this issue Nov 5, 2022 · 3 comments
Open

Replace pry-byebug with ruby debug in generated Gemfile #399

eoinkelly opened this issue Nov 5, 2022 · 3 comments

Comments

@eoinkelly
Copy link
Contributor

Motivations

  • debug is installed by default on Ruby 3.1 but supports back to 2.6
  • debug is the default in Rails and we should align with Rails defaults whenever possible
  • there is an incompatibility between Zeitwork and byebug - see Depend on ruby/debug, replacing Byebug rails/rails#43187
  • debug is part of ruby stdlib so will get new language features immediately
  • debug apparently has good VSCode integration (I have not tested this)

Challenges

Mitigations

  • A dev could backport this change pretty easily to an existing app if they don't want to remember both sets of shortcuts.
@eoinkelly
Copy link
Contributor Author

Some more resources

My experience with debug vs pry-byebug for a morning

++ is for ways it debug is better than pry-byebug, -- is for the reverse

  • ++ debug has color output in backtraces
  • ++ Backtrace in debug contains values of method call or block arguments
  • ++ de bug has single letter commands by default
  • -- new command shortcuts to learn
  • ++ debug shows you the first two lines of backtrace when you drop into the debugger - handy
  • ++ very expressive ways to drop into debugger - can watch ivars, stop on lines or class#method or based on conditional logic
  • -- I had to install the iterm2 shell integration to make mouse scrolling work in debug (this might just be an iterm thing)
  • ++ debug supports running things under Procfile like Rails 7 wants to do by default

@G-Rath
Copy link
Contributor

G-Rath commented Aug 24, 2023

I've put exactly zero effort into learning debug so maybe there's a flag or something I'm missing, but trying it out on my project where I'm just doing require "debug"; binding.break I've found that exceptions seem to cause the debugging to end whereas for binding.pry that doesn't happen.

In practical terms this missing if you trigger a "method missing" it'll exit your debugging session which is very annoying so I think we should have it on the list of things to ensure we understand (and ideally have addressed if possible)

@eoinkelly
Copy link
Contributor Author

Hmmm I haven't hit that but I agree it would be annoying. Removing ready for dev label until we gather more experience on individual projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants