I see this question from two sides,
First, the most common perspective, which most of us are already talking about: From the point of view of the one who sees the logs and tries to correct the error: I believe that both messages provide equal information.
The second perspective is the one who reads / maintains / looks at the code: As we talked with age about the readability and simplicity of the code. Thus, it is also no less important.
We are convinced that my code should be simple and self-evident, so that there are no explicit comments, and I strongly agree with it.
From this point of view:
These messages make reading and viewing code easier, as they serve the dual purpose of documentation, as well as reporting errors:
assertEquals( "objects should be identical", expected, actual ); assertTrue( "flag should have been set", flag ); assertNotNull( "object must not be null", object );
These posts are not so reader friendly as they speak of an unexpected state:
assertEquals( "objects aren't identical", expected, actual ); assertTrue( "flag is not set", flag ); assertNotNull( "object is null", object );
Mohd Farid Dec 20 '15 at 5:59 2015-12-20 05:59
source share