Hi,
On 17 Oct 2002 18:56:24 +1000
Robert Collins <robertc@squid-cache.org> wrote:
>On Thu, 2002-10-17 at 18:26, Evgeny Kotsuba wrote:
>
>> What about "not to use templates and STL" ?
>
>Use of the STL needs to be considered. Certainly I won't be
>leveraging
>the STL at this point, the squid codebase is too procedural to
>benefit
>at this point.
Well. Please look at http://www.wxwindows.org/faqgen.htm and take in
mind that wxwindows is deeply-OO/++
As for me it is impossiple to catch errors in temlates via debugger
and I can't catch errors by Cnin-Gach-Gook methods (via long
meditation over the source)
>
>> >file naming: .h files should only declare one class.
>> it will fine if we have few non- related classes
>
>Huh? Not sure what you mean. Can you enlarge on your comment?
>
say we have
class shortClassA
{
}
class longClassB
{
....
shortClassA blabla;
shortClassA blabla1;
shortClassA blabla2;
.....
}
and shortClassA is used only in longClassB
>> What about "do not place" member functions in .h, exept very short,
>
>We want as few restrictions as possible, to encourage flexible
>development. Any non-core contributions will (of course) get
>reviewed.
>So if something seems inappropriate we can ask that it get moved.
>It's
>very easy to move member bodies from .cc to .h and vice verca. SO I
>don't think we need to set a specific rule about this.
Well, than it can be "reccomended do not place".
Again, is it possible to debug well the code placed in .h ?
>
>> what about "not use static initialisation" exept for structures and
>> structures-like classes ?
>
>static initialisation is incredibly useful. So why not use it?
But how to catch erros etc. before main() is started ?
As for squid - how to do smthg before config is read ? And say, how to
reinit squid at runtime - should we have both static and dynamic
initializations ?
>
>> What about "don't use exeptions" and other devil constructions ?
>
>exceptions are of little use in squid due to the heavily callback
>based
>design. (exceptions are designed for call stack unwinding, which
>becomes
>invalid in our environment). However, there may be use for exceptions
>to
>replace some of the fatal() and assert() calls with a more flexible
>mechanism. For now though, certainly exceptions should be very
>rarely,
>if ever, used.
>
>What other 'devil constructions' are you referring to?
I have deal with some code where memory management was build on ++
exeptions. As it was written in some books by big scientists. It was
nightmare. It was impossible to use any general technics to catch
errors with memory usage...
Templates. Platphorm - specific templates. Recursive called .h
//file1.h
...
#include "file2.h"
//file2.h
...
#include "file3.h"
//file3.h
...
#include "file1.h"
....
SY,
Evgeny Kotsuba
Received on Thu Oct 17 2002 - 14:59:59 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:16:56 MST