[phobos] Why ConvError and not ConvException?

Jonathan M Davis jmdavisProg at gmx.com
Tue Nov 16 17:05:09 PST 2010


On Tuesday, November 16, 2010 16:48:31 Sean Kelly wrote:
> On Nov 16, 2010, at 4:03 PM, Jonathan M Davis wrote:
> > On Tuesday, November 16, 2010 14:45:39 Shin Fujishiro wrote:
> >> Yeah, I agree that suffixed Exceptions are very clear.  I wrote it
> >> because std.concurrency has non-suffixed exceptions such as
> >> MessageMismatch, which are still clear thanks to negative terms
> >> embedded in their names.
> > 
> > Well, then I'd argue that those exception classes should have their names
> > changed to include Exception, but the negative terms embedded in their
> > names do make them work as they are. It's just inconsistent, and
> > generally-speaking, such inconsistencies in a library should be avoided
> > unless there's a good, overriding reason to have them.
> 
>  Changing the name would create an inconsistency with TDPL.

Well, that would be a reason not to do it, though it wouldn't be the first 
permanent inconsistency with TDPL. Certainly, I think that the general rule 
should be that the names of exception types should end in Exception and the 
names of error types should end in Error. That doesn't necessarily mean that we 
should never do otherwise, but I think that we should have a good reason if we 
do. A conflict with TDPL would arguably be a good reason, though I think that I'd 
still want to change it and leave a deprecated alias (albeit one which would 
probably have to stick around at least until the next version of TDPL comes 
out). Regardless, I think that the general naming convention should be used 
unless there is a good reason otherwise.

- Jonathan M Davis


More information about the phobos mailing list