C++ can be worse. I wanted to use the Boost Spirit library for CFG
parsing, and found that I couldn’t read the compile errors I was
getting because 90% of the text was multiply nested template types. The C++
Standard Template Library uses templates so much to get close to Ruby’s
flexibility, but the result is still more complicated than Ruby,
impossible to debug, and less flexible. At that point, why not go all the
way to a dynamically typed language?
Because then you’re a different language with different use cases with
different benefits and drawbacks.
Boost is an incredibly good set of libraries, with an extremely high
level of QA. The great tragedy is that facilities like this were not
part of a C++ standard library a decade ago.
Still, the C++ Standards Committee are well aware of the problems that
templates cause with respect to indecipherable error messages, which
is why the new system of concepts has been proposed for C++0x, so the
compiler can flag straight away when you’ve tried to instantiate a
template parameter that won’t work.
Also, if you’re a genius, you can use template metaprogramming to do
some really spanky compile-time shenanigans.