Live data from Hacker News

Icecream: Never use print() to debug again in Python

github.com

1–10 of 271 posts

Re: Icecream: Never use print() to debug again in Python

#7

I am always going to use print to debug in every programming language I can until the day I die.

I have found that print-style debugging gives a good birds-eye view of the situation.

With a stepping debugger, I tend to get lost in the weeds. My suspicion is that the bug fixes I come up with are less holistic when using a debugger.

Re: Icecream: Never use print() to debug again in Python

#8
For an even easier-to-remember alternative, there’s q: https://github.com/zestyping/q

All you need is `import q`. q works like a function (q(x)), like a variable (q|x and q/x, so you get different operator precedences) and like a decorator (@q), so it can be used in practically any circumstance for a quick debug print. Plus, the name sounds like you’re interrogating something.

Post reply on HN