The URL for the Japanese blog should be techracho.bpsinc.jp/hachi8833/2022_09_01/121134
Debugging, like programming, is both art and science. There are wonderful new tools to support finding that defect that someone else put into your code - hey it wasn't me my dog made that typo that took days to find ...
The oldest debugging technique that I know is the language equivalent of Ruby's
puts "DEBUG my_variable: #{my_variable}"
The ubiquitous named variable value output. It not only gices you the value of the variable it also provides a tracing capability.
Regardless of how good our tools get, sometimes it is the old ways that help find the problems. That is why I wrote the "debug_me" gem a long time ago. I still use it in large rails applications trying to find out which of the thousands of M or V or C components is causing the problem.
Just because something is old, doesn't mean it has no value.
0-*
Thanks, Stan. Very useful. One problem I have with debug is that I tend to use with a binding.debug stop points in the code. If I mis-type an expression when stopped, e.g., this_vra instead of this_var, it crashes the debug session. Does anyone else get this?
Hi Stan, thanks for the detailed comparison. I personally use rubyyard (rubyjard (dot) org) for this purpose, which is - in essence - a tmux-wrapper to byebug. I'm not sure, if a migration is advisable.
tnir
tnir
The URL for the Japanese blog should be https:// techracho.bpsinc.jp/hachi8833/2022_09_01/121134