Typography in foreign error messages Lassi Kortela 27 Jul 2020 08:13 UTC

SRFI 198 should probably recommend standard typography for error messages:

1. Should error messages start with a capital letter or a small letter
(of course, proper nouns and acronyms should be capitalized anyway)?

2. Should error messages end with a period or not?

3. Should error messages end with a newline or not?

My opinions:

1. It's better if they start with a small letter. It's easy for the
caller to capitalize a small letter, but if a message starts with a
capital letter, it's not clear whether or not it's a proper noun so the
client doesn't know whether it can turn it into a small letter.

2. It's better not to end with a period. It's easier for the caller to
append a period where needed than to remove an existing period.

3. Should not end with a newline. This is rare, but some Windows API
errors are returned with trailing newlines for some reason. We should
recommend that those are trimmed out.

If all libraries returning SRFI 198 adhere to the same typographic
conventions (irrespective of which ones the C libraries use), that will
lead to a nice and predictable result for Scheme programmers.

It would be even nicer if error messages from native Scheme libraries
use the same conventions as well. IIRC Common Lisp has a de facto
convention of capitalizing error messages, but I'm not sure.