I'd go further and say "never judge a developer by the code they write without knowing 100% of the context". So many times developers trash each other for shitty code quality without knowing anything about why the code was written the way it was. There isn't always good reasons for "excellent code", sometimes good enough is perfect. We like to think we all live in a vacuum where there is no reason for code to not be perfect, but we forget we live in an environment which is not perfect, and the code is meant to contribute to the this environment, sometimes leading to less-than-perfect code.
So before you judge your fellow developer based on code, ask them first to explain the context around the code, before jumping to any conclusions.