Re: Squid 3 development open

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Mon, 21 Oct 2002 11:23:21 -0600 (MDT)

On Thu, 17 Oct 2002, Joe Cooper wrote:

> >>>What about "not to use templates and STL" ?
> >
> > Actually, I expect template use to increase relatively soon. templates
> > are *very* *very* *very* useful. Parameterised types make things like
> >
> > lists, heaps, vectors typesafe without having multiple inheritance (not
> > really appropriate for list management) or typecasts, or inexplicable
> > fields at specific locations in structures.
>
> I've always been for templates and leveraging existing code where
> reasonable (i.e. STL and Boost seem like great places to borrow a
> stepladder), but I recall Alex and Henrik both had some well-reasoned
> comments opposing their usage.

Please do not mix "use STL" with "use templates". These are separate
issues. Simple templates should not be discouraged. They are often
very helpful despite C++ limitations when it comes to generic
programming.

You should use STL only if you are prepared for

        - major increase in "make all" duration
          (I have seen x3-5 slowdown in comparable applications:
           Web Polygraph versus Co-Advisor)

        - decrease in the number of people that can write
          correct performance-sensitive code

        - serious portability issues on some platforms most people
          do not care about

        - side-effects of the above

Everything else is probably minor. I understand that Squid core is not
STL-friendly by design, but there are still many (enough) places that
can benefit from STL.

And no, GCC does not have excellent support for STL, but one can leave
with the current [good] level of support and hope that it will
gradually improve. Expect to write xStl.h files to work around [GCC]
STL issues, but, again, that is minor.

FWIW, if we were to start from scratch today, Web Polygraph would use
STL.

Good luck,

Alex.

-- 
                            | HTTP performance - Web Polygraph benchmark
www.measurement-factory.com | HTTP compliance+ - Co-Advisor test suite
                            | all of the above - PolyBox appliance
Received on Mon Oct 21 2002 - 11:23:22 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:16:59 MST