DEV Community

Discussion on: “Print” Is the Only Debug Tool You Need

Collapse
 
chuniversiteit profile image
Chun Fei Lung

Printing seems easier at first, because it’s so intuitive and doesn’t have much of a learning curve.

Debugging on the other hand requires you to invest a little bit of time beforehand to set everything up, but after that it’s fairly easy. Most languages I know come with a debugger. Debugging tends to work in roughly similar ways across different tools, especially if those tools are part of the same family (e.g. JetBrains IDEs), so it’s not that different from having to look up what command you need to print things. And as an added bonus you no longer run the risk of getting “You forgot to remove this print/log statement” comments in pull requests. 🙃

Having said that, I still use print statements from time to time, but only when writing tiny unit tests and languages that I rarely use.