Operator overloading is a notion originating from mathematics, where there are literally *infinite* numbers of things to write down, and only a few recognizable symbols with which to write them.

The idea is that if you re-define symbols at the beginning of your paper, and use them consistently, you can convey complicated ideas concisely for the benefit of people smart enough to be professional mathematicians. On the other hand, what you just wrote will to total gibberish to anyone else.

Notation can often get complex: one typically defines symbols from the greek and Roman character sets, but ocassionally the work gets so complicated that random doodles and squiggles get used, or symbols from other foreign languages (which can be a problem for people unfamiliar with the symbol in use, as in "No, that's a squiggle with a *DOT* over the duck, not a squiggle with a *DASH* over the duck! NOW it all makes SENSE!")

Fortunately, most computer languages use the convention that functions are defined at the *word* level, rather than the *character* level, allowing one to define functions with more than one letter. This is less concise, but often a lot more readable (which makes sense, because we have a lot more programmers than we have professional mathematicians).

In short, operator overloading is an old school mathematical hack, to save symbols, to ensure that the reader is familiar with the symbols, ensure that the symbols could be typeset on a roman keyboard, or even occasionally to try to make notations simpler (which rarely worked, then or now). For programming, we already have notations that work well enough; redefining them is about as silly as redefining PI to be the square root of two: possible, but just a bad idea all around. Unless there's a very, very, strong reason to overload things, just don't do it.

Just my $0.02,
--
Ytrew


In reply to Re: Overload abuse or is it just me? by Anonymous Monk
in thread Overload abuse or is it just me? by salvix

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.