Hacker News new | ask | show | jobs
by kelvin0 4190 days ago
I have been using python for some years now (although I'm no Guru..) and have almost always been able to debug using PDB or a python IDE. I'm not sure how this helps debugging? Is it debugging through some type of logging? I haven't checked out the source code yet, and the site is fairly brief on actual use-cases. Thanks for any feedback.
1 comments

I wish I could give you pros and cons, but I've never touched pdb or used a python IDE before myself. In my 3 years of programming, I've only used print statements to debug (for Python programs).

I'll be adding more documentation soon, but perhaps this is a more informative use case: Too often in my Python programs, I'll do something like, print("x is: " + str(x)). That's already too much to keep typing, but sometimes I'll want to know the type, or maybe it's a dictionary and printing without separators makes them blend together (say, in a for loop). In that case, I'll do: print("---------\nx is: " + str(x) + "\n")

The library allows this to be simplified to "ps.d(x)". It's rather opinionated towards my own workflow and what I was too lazy to keep doing. Perhaps I'll try pdb one day and find my library useless.

But, it's dead simple to use an IDE. Plus the code you debug within the IDE is the same as the production code. It allows to use breakpoints, and watch vars. There are a bunch of free IDEs, what don't you like about using one?
You think you misunderstood; I didn't try it and not like it, I just never tried it. I'm most productive on Vim/Terminal right now. From a quick google search, it doesn't seem like I can use all the Vim commands in an IDE (though I see some articles on using Vim AS an IDE). Have you personally tried both and preferred an IDE over Vim/Terminal?