C# interview

Adam D. Ruppe destructionator at gmail.com
Tue Oct 7 05:39:58 PDT 2008


On Tue, Oct 07, 2008 at 02:21:23PM +0200, Don wrote:
> My point is simply that:
> 
> Object o;
> 
> is almost always an error, and I think that making it illegal would 
> catch the #1 trivial bug in D code.

I agree here. When I first started with D, I would write that almost
every time I was working with an object, and it would segfault without
fail.

In C++, writing Object o; is quite common, and as a C++ user coming to D,
it took me a while to get away from that habit. I'm sure other C++ users
have had the same experience.

This change definitely seems like a good idea. If it breaks existing code,
it is easy enough to add the = null if you need it, so there is little cost
and I think a decent gain.

-- 
Adam D. Ruppe
http://arsdnet.net



More information about the Digitalmars-d mailing list