[Gllug] C++ Templates, Opinions?

Holger Duerer hduerer at gmx.net
Tue Dec 21 10:00:47 UTC 2004


>>>>> "Nix" == Nix  <nix at esperi.org.uk> writes:
    Nix> On Sun, 19 Dec 2004, Holger Duerer whispered secretively:
No, no.  You got that wrong.  Nothing to hide.  Spoken loud and
hopefully clear. :-)

    >>>>>>> "Nix" == Nix  <nix at esperi.org.uk> writes:
    >> [...]
    >> 
    Nix> Oh, Alexandescu is *smart*. Policy classes are a *genius*
    Nix> idea.  The only problem with template metaprogramming is that
    Nix> because it wasn't actually an original design feature of C++,
    Nix> its syntax is rather baroque and hard to read.
    >> 
    >> While very true, this statement hides the biggest problem with
    >> templates in today's compilers: If you think the template
    >> source code is difficult to read then you will be completely
    >> lost with the error messages produced when things go wrong.
    >> With current compiler technology templates are only for writing
    >> correct code (the compiler won't help you much if you write
    >> wrong code) -- and we all know how easy that is...

    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.

    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...
I am sure in a mere five to ten years the compiler technology will
have matured enough to cope with today's programming trends.

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.


Oh well... back to writing C++ code then...

   Holger
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list