Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Debuggers are more efficient at locating and fixing specific bugs. However when you debug with print statements you get the opportunity to review the code and find bigger design problems that need to be fixed.

Furthermore, and more controversially, if you debug with debuggers, you will be driven to use programming techniques that are friendly to your debugger. But when you debug with print statements, you are free to use whatever programming techniques are best for human comprehension.

Now before you raise your keyboard and rush to disagree, consider carefully that the position I just described is agreed with by well-known programmers such as Linus Torvalds and Larry Wall. There are equally well-known programmers who disagree.

The true merits of the case are hard to determine. But if you think that one side is trivially wrong, then you should view this as a learning opportunity. Because you're certainly mistaken.

See http://lkml.indiana.edu/hypermail/linux/kernel/0009.0/1148.h... and http://www.perlmonks.org/?node_id=48495 for more background on this topic.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: