Safer casts

Yigal Chripun yigal100 at gmail.com
Sun May 11 06:06:08 PDT 2008


Janice Caron wrote:
> On 11/05/2008, Yigal Chripun <yigal100 at gmail.com> wrote:
>>  also, what if a doesn't actually have a "member" member? this is still
>>  syntactically valid D code, but again I think the error would be
>>  reported elsewhere.
> 
> On that point, I concede. The reporting of template errors could
> certainly be improved. More than once I have wanted to see the "stack
> trace" of errors, working back from the innermost, to the line of code
> that ultimately triggered it.
> 
> However, that it not an argument against templates, it is an argument
> for improved error reporting. And hopefully, one day we'll get that.
> 
> This is not the first time that you've argued that some feature or
> strategy is bad because today's D compiler isn't good enough, but you
> need to remember that tomorrow's D compiler will be better. That's
> life on the cutting edge.

are we now debating the "sufficiently smart compiler" problem? ;)
I'm just kidding. But seriously, That is just another symptom of the
issue. the main thing is that the STL design of a collection of generic
templates is wrong, for all the reasons I've stated. C++ experts have
this mindset of all we got is a hammer(templates), so all the problems
are nails" which is simply not true.
templates are a useful feature which unfortunately is greatly overused.

The same thing can be said above Java and configuration files in XML.
Java programmer sometimes you some Java code to glue their XML
configuration files. Again, nothing's wrong with xml itself. XML is a
grea thing when used properly, the issue is that not all problems can be
solved with XML configuration files.

Maybe your rich C++ experience affects your judgment regarding this?

--Yigal



More information about the Digitalmars-d mailing list