• Chrobin@discuss.tchncs.de
    link
    fedilink
    arrow-up
    7
    ·
    3 days ago

    As a computational physicist, I appreciate operator overloading IF used properly.
    Example of a good use: + for matrix addition
    Example of a bad use: left shift operator << as a pipe
    I still don’t understand who’s in the C++ committee that they would choose this garbage over a function

    • tyo_ukko@sopuli.xyz
      link
      fedilink
      arrow-up
      2
      ·
      20 hours ago

      My theory is that they came up with the concept of operator overloading (or copied it elsewhere and were exited) and decided the best place to demonstrate and sell the concept is in the most used console input and output standard functions.

      Edit: I realize my contempt for this decision is not evident here, so let me add that it was a terrible choice in their part indeed.