The Right Approach to Exceptions

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Feb 20 12:58:39 PST 2012


On Mon, Feb 20, 2012 at 02:46:52PM -0600, Andrei Alexandrescu wrote:
> On 2/20/12 1:17 PM, Juan Manuel Cabo wrote:
> >I like the idea!
> >
> >Remember please for anyone reading: Use positional arguments in
> >format strings.
> 
> Not positional, but instead Symbolic is the way.
[...]

+1.

Nothing worse than a format string like this:

	"{0}:{1} {2} occurred in {3} {4}: {5}"

Much better is:

	"${srcfile}:${linenum} ${errortype} occurred in ${objecttype}
	${objectname}: ${detailmsg}"


T

-- 
It is the quality rather than the quantity that matters. -- Lucius Annaeus Seneca


More information about the Digitalmars-d mailing list