[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (OT) Re: memory management







>> Overloading is OK - (great in fact) - but OPERATOR overloading is evil
>> because
>> it can result in people writing code that leads you to believe you
>> understand
>> it when in fact you don't.
>
>Hm, that doesn't sound like a problem of the tool, but a problem of the use
>of the tool.  Matrices, vector algebra etc are perfect for operator
overloading,
>no ?

I'd have to agree. For every time I've seen an operator overloaded to do
something odd, I've seen a hundred function names that are completely misleading
about what happens, and yes, matrix algebra (a dense subject at the best of
times) can be expressed neatly and succinctly with operator overloading.

I'd throw in strings as another good place... being able to add them's a damn
sight more convenient than function calls.