All asserts need to have messages attached! Explicit as possible!

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 10 04:28:44 PDT 2017


On 2017-07-08 04:13, Jonathan M Davis via Digitalmars-d wrote:

> I tend to agree - in many cases, the error message is completely redundant -
> but a number of folks seem to think that you should never have an assertion
> without a message, and it tends to get complained about if you have an
> assertion without a message if it's not in a unit test, so I'm a bit
> surprised that the OP ran into one in Phobos.

I think it's extremely useful to have, especially in a code base you're 
not familiar with or is complicated. It has happened to me quite often 
that I hit asserts in DMD when I develop on that code base. It would 
help me a lot if all those asserts had descriptive messages.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list