I am always going to use print to debug in every programming language I can until the day I die.
Absolutely, I don't understand why using print() or its equivalent in other languages is looked down upon. It's quick way to narrow down the "area of search" before bringing in the big guns.
Icecream: Never use print() to debug again in Python
71–80 of 271 posts
Re: Icecream: Never use print() to debug again in Python
#72I am always going to use print to debug in every programming language I can until the day I die.
Why not taking the (short) time to learn using a debugger? This is way more efficient way to work for complex situations.
Re: Icecream: Never use print() to debug again in Python
#73I promise the 15 minutes it takes to learn to use the debugger will save years of your life
Re: Icecream: Never use print() to debug again in Python
#74Why don't people just use a debugger? It boggles my mind that people live with print style debugging. Depending on the project, it can be such a timer waster and just plainly worse in all aspects. Especially in Pycharm for me, it is incredibly easy. Even when running over ssh in remote computers I can use my debugger.
Re: Icecream: Never use print() to debug again in Python
#75Why don't people just use a debugger? It boggles my mind that people live with print style debugging. Depending on the project, it can be such a timer waster and just plainly worse in all aspects. Especially in Pycharm for me, it is incredibly easy. Even when running over ssh in remote computers I can use my debugger.
Debuggers are great. But to unboggle your mind, here’s why I don’t use a Python debugger. I don’t write enough Python to justify the time to learn the debugger. I write just enough to help my staff/teammate fix their problem or debug some tool I’m using and move on. I’ve been doing this long enough to lose interest in digging deeply into each language. I learned gdb for C. After that I learned jdb and Eclipse for Jav…
Re: Icecream: Never use print() to debug again in Python
#76Earlier quoted context omitted.
Do you have any concrete usage examples of that? I’ve only used breakpoint() to stop execution while debugging.
In the docs you can look up breakpoint, it has a lot of features amongst other things you can register a custom handler. I use it in selenium tests so I can either debug on error or just print the error message and continue
Re: Icecream: Never use print() to debug again in Python
#77Earlier quoted context omitted.
I have debugger set in pycharm and use it all the time. I also use print all the time, often along with the debug tool. They are very complimentary and neither tool can do everything the other can.
TBF if you always run your programs in pycharm and use its debugger, you can trivially use non-suspending "evaluate and log" breakpoints instead of print.
I can remove prints by just checking out the latest version of the file.
Re: Icecream: Never use print() to debug again in Python
#78Re: Icecream: Never use print() to debug again in Python
#79I promise the 15 minutes it takes to learn to use the debugger will save years of your life
Not necessarily. I know very well how to use a debugger, but nowadays I just prefer to use prints: it forces to you actually think about what's happening instead of just looking at it. It's also more useful in situations where putting a debugger actually changes behavior (high performance systems, parallel programs).
Re: Icecream: Never use print() to debug again in Python
#80I am always going to use print to debug in every programming language I can until the day I die.