[Gllug] C++ Templates, Opinions?

Nix nix at esperi.org.uk
Sat Dec 25 00:08:06 UTC 2004


On Tue, 21 Dec 2004, Holger Duerer wrote:
>>>>>> "Nix" == Nix  <nix at esperi.org.uk> writes:
>     Nix> On Sun, 19 Dec 2004, Holger Duerer whispered secretively:
>     Nix> That's a sucky compiler, though, not anything else. GCC
>     Nix> 2.95.x was so bad at this it was laughable: miss off one
>     Nix> semicolon, get a 100K-long error message :)
> 
> That's exactly my point.  I didn't say C++ templates were bad per se
> (except for their uglyness of course, but then again, we only write
> code, nobody of worth ever has to read it -- anybody so low as to
> accept a software maintainance job deserves what they get) just that
> today's compiler suck.

C++ template syntax *is* sucky, yes, particularly if you're doing
template metaprogramming: but in that case, you should make your code
sufficiently generic and bulletproof that it won't need much
maintenance, or (preferably) use a metaprogramming layer doing the
desired job written by someone else that you don't need to maintain ;)

Template metaprogramming is black, black magic, and like all such,
it's decidedly ugly.

>     Nix> GCC 3.4 should be much, *much* better at this than earlier
>     Nix> GCC's; 4.0 will be better yet.
> 
> Yes, I know that feeling -- tomorrow all our problems will be gone...

Well, GCC 3.4 has been out for months :)

> And all those people who are still forced to work with VC++6, gcc 2.x
> and what have you should seek a new employer or suffer in silence.

... or force your employer to upgrade, like I did.

(The only reason to work with GCC 2.x these days, IMNSHO, is if you're
using a platform obsoleted in a later release.)

-- 
`The sword we forged has turned upon us
 Only now, at the end of all things do we see
 The lamp-bearer dies; only the lamp burns on.'
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list