Friday, January 15, 2010

Why System.out.println("logging messages") is bad

It is university assignment standard to conduct logging, and it is bad.

- is always printed to output stream
- shows information in the console that is not relevant for the end user
- code must be deleted/commented out to disable output
- programmer must take care of formatting
- no filtering, everything is printed out
- unknown which part in the code generated the output

Man, I saw heaps of System.outs in an industry-renowned production system. So don't be surprised professional coders are still using the mechanism for logging. Sigh...

No comments: