Re: C++

From: Robert Collins <robertc@dont-contact.us>
Date: 12 Sep 2002 20:02:51 +1000

Some more:

On Wed, 2002-09-04 at 10:00, Henrik Nordstrom wrote:
> I prefer not. I think Squid-2.X should be kept pure C.

It's becoming harder and harder to make developer-time-efficient changes
to squid 2.x. There's a lot of good code that we can refactor and use
for 3.X. Unless we plan to all stop hacking 2.x one day, we will need to
maintain duplicate code bases - unless we migrate bit by bit.
 
> Apart from the preference of pure C I think throwing C++ into the mix
> would be too much of a mixed mess in the same program.. You would end
> up with parts using C, parts using C with a touch of OO, parts using
> C++ with a touch of C, and parts using C++ OO.. 4 differnt coding
> approaches (we have 2 today), 3 different memory allocation schemes
> (have 2 today).

I don't see that multiple approaches is necessary. C++ supports
overloaded new and new[] operators which we can *trivially* map into
MemPools. That means we would have 4 coding styles:
procedural C
semi-oop C
c in conversion to C++
Good C++.
and 2 mem alloc schemes:
Mempools
cbdata.

> Please note that there is also subtle differences in the language
> syntax, such as slightly different operator priorities.

And in some allowed names in structures, and the like. I've built squid
with G++ and it seems happy, one structs.h is cleaned up a bit.

Rob

Received on Thu Sep 12 2002 - 04:02:29 MDT

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