strong/weak typing and pointers

Michael Hobbs mike at hobbshouse.org
Tue Nov 2 10:31:36 EST 2004


Andrea Griffini <agriff at tin.it> wrote:
> You didn't mention C++. Try this ...
> 
>   std::string s = "Wow";
>   s += 3.141592654; // Perfectly valid
>   s = 3.141592654;  // Also valid

Those automatic coercions are always handy when writing code, but a
pain in the @$$ when reading it. I can't count the number of times
that I stepped through C++ code, saying "what the ...?", only to 
realize that there was some perlish 'operator +=(const **' statement
tucked away in a header file somewhere. Good riddance, I say. (My
code only overrides the __or__ operator. ;-)

-- Mike



More information about the Python-list mailing list