Why is exception.printStackTrace() considered bad practice?
问题 There is a lot of material out there which suggests that printing the stack trace of an exception is bad practice. E.g. from the RegexpSingleline check in Checkstyle: This check can be used [...] to find common bad practice such as calling ex.printStacktrace() However, I'm struggling to find anywhere which gives a valid reason why since surely the stack trace is very useful in tracking down what caused the exception. Things that I am aware of: A stack trace should never be visible to end