pingus-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: none


From: David Philippi
Subject: Re: none
Date: Fri, 7 Jun 2002 20:19:26 +0200
User-agent: KMail/1.4.1

On Friday 07 June 2002 19:55, Ingo Ruhnke wrote:

> The dummy_ptr<> did IIRC also init the value with zero, instead of
> some undefined random value, but your are right, the loss of using
> dummy_ptr might be bigger than the gain. Can remember if I ever
> catched a bug with them.

A pointer should alway be initialized in place or in the constructor. 
Everything else is an invitation to very ugly errors. :-)
They won't really help you anyway - if they encounter a 0 pointer they just 
called "assert(0);" this would lead to a call to abort() and since the line 
number is in the dummy_ptr code you have to open the core. ;-)

[terrible code]
> I guess I know why some people say C++ is ugly...

I guess I know why some people get beaten for the code they write. ;-)
It's not a problem of C++, you may write unreadable code in every language if 
you want. The only real problem of C++ is, that it is hard to learn it since 
there's quite a lot to learn.

> Yep, most or all of them could be replaced by normal pointers if the
> structure how and where the 'new' takes place is changed.

Well, this is something a bit too internal for me yet. If I tried to work on 
this right now it would probably produce a lot of errors. But I'm still 
working on include reduction anyway - big cvs commit coming very soon. I 
didn't do any benchmarks, but I'd say that the compilation and especially 
the linking are much faster now in my tree.

Bye David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]