I would like to think that programmers would like to know when they're doing something "wrong", since poor code is usually inefficient (to write or execute), difficult to maintain, or both.
When pointing out low quality code, the ideal way would be to show them a better way to write it. There's a Haskell pastebin that I occasionally use that points out all sorts of things like unnecessary parentheses or recommends a different function than one I've used.
For instance, this is how I was writing a particular piece of code in Haskell:
(sequence_ $ map (PG.execute [sqlFile|sql/deletePhoto.sql|]) photos)
This is the cleaner way of writing it that does the same exact thing:
mapM_ (PG.execute [sqlFile|sql/deletePhoto.sql|]) photos
I would have never known about the cleaner way if it hadn't been pointed out to me, and I am always happy to learn these kinds of shortcuts.
Sometimes what's wrong can't be demonstrated by showing a neat little block of code because it is a fundamentally bad design to begin with (such as using
Sometimes the best way to learn is to make mistakes, but mistakes can be difficult to discern for a new programmer.