finding errors with templates without instantiating them

Jonathan M Davis jmdavisProg at gmx.com
Thu Sep 12 12:46:38 PDT 2013


On Thursday, September 12, 2013 11:59:52 monarch_dodra wrote:
> On Wednesday, 11 September 2013 at 22:22:46 UTC, Jonathan M Davis
> 
> wrote:
> > On Wednesday, September 11, 2013 15:15:39 Andrei Alexandrescu
> > 
> > wrote:
> >> I'm not against it, but I find it a very small improvement.
> >> Its user
> >> base is exactly people who want to write and deploy a template
> >> without
> >> ever testing it at all, ever. I have a hard time catering to
> >> that
> >> hypothetical crowd.
> > 
> > That crowd deserves whatever bugs they get.
> > 
> > - Jonathan M Davis
> 
> *cough* Phobos is that crowd *cough*
> 
> Seriously. Most new code is tested, however, there is a ton of
> older code that is not only not-tested, but not even *compiled*:
> https://github.com/D-Programming-Language/phobos/pull/1514
> 
> Not that I'm necessarily *for* said feature, but I think we need
> to re-evaluate who this "hypothetical crowd" is, before looking
> down on it.

I don't think that there's any question that we've had some fairly poor 
testing of a lot of templates in the past, but you have to do that testing 
regardless if you want to make sure that your code is valid. So, best case, 
this feature would point out that you were too negligent to even bother 
testing beyond maybe the most basic of tests. I really don't think that it's 
worth the extra complication in the compiler and the additional cost to the 
compiler developers' time, particularly when it's likely to introduce new bugs 
that would have to be fixed when we already have plenty of way more important 
issues that still need to be fixed.

I think that if this sort of thing is to be considered, it needs to be 
considered after all of the far more major issues have been resolved.

- Jonathan M Davis


More information about the Digitalmars-d mailing list