wiki: CodeReviewComments should have better example for lowercasing error strings #49196
Labels
Documentation
Issues describing a change to documentation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
In the Readme https://github.com/golang/go/wiki/CodeReviewComments#error-strings it states:
The example is bad and the justification given is weak. For example, a sentence case error message parsed by
log.Printf("Reading %s: %v", filename, err)
might produce the following:Reading file.txt: Something bad
. This is perfectly fine English. Programming style conventionally follows American usage, "A colon is not normally followed by a capital letter in British usage, though American usage often prefers to use a capital." Thus, there is no problem presented in the example given, and in fact, American usage should by rights protest the lack of the capital letter. Surely there is a better example that should be given for this rule!Furthermore, I think it much more likely that the reason for requiring error messages to be lowercase is to avoid the issues that arise if mixed case error messages are acceptable. For example, if one error message is
Something bad
and another issomething bad
, an issue occurs that the error messages are different but likely had the same intended meaning. By requiring the case to be one way and not the other, we reduce the risk of accidentally creating new messages.In conclusion, the rule is good. We should continue to start error messages with lowercase letters, but we should drop these bad examples and (in my opinion) post hoc excuses to justify the rule.
The text was updated successfully, but these errors were encountered: