What's better about Ruby than Python?

David Abrahams dave at boost-consulting.com
Thu Aug 21 23:39:02 CEST 2003

Roy Smith <roy at panix.com> writes:

> One of the few things I like about C++ is that between const, templates, 
> and inline, the need for the macro preprocessor has been almost 
> eliminated.  

Har!  If anything it has been increased!  Boost, a haven for template
experts, has a whole library which formalizes a programming system for
the preprocessor (http://www.boost.org/libs/preprocessor) just so we
can eliminate the nasty boilerplate that arises in our template code.

> Still, you see a lot of code which goes out of its way to 
> do fancy things with macros, almost always with bad effect.

I guess it's a question of how badly you hate maintaining 25 different
copies of similar code.  And, BTW, I tried to "just use Python to
generate C++" first and using the preprocessor turns out to be
significantly better.

BTW, the C++ preprocessor is a fairly weak macro system.  A higher
level metaprogramming facility that knows more about the underlying
language could be a lot cleaner, clearer, safer, and more expressive.

Dave Abrahams
Boost Consulting

More information about the Python-list mailing list