News for hackers. Stuff that matters.
Re:C++23: The Next C++ Standard by throwaway894345 on Tuesday July 11, 2023 @03:32PM (#36686152)
You read the code. And unlike operator overloading, you know at a glance exactly which implementation to look at. There is no spooky action at a distance.
Re:C++23: The Next C++ Standard by joshuamorton on Tuesday July 11, 2023 @04:05PM (#36686539)
How, the functions might support dynamic dispatch or be overloaded based on types.

There's nothing that prevents me from implementing all of

    plus(Int, Int)
    plus(Int, Vec)
    plus(Int, Mat)
    plus(Vec, Vec)
    plus(Vec, Mat)
    plus(Mat, Mat)
and to know which `plus` is being dispatched, you need to know the types of both arguments, exactly the same as if `plus` is named `__add__` in python or `operator+` in C++.
Re:C++23: The Next C++ Standard by throwaway894345 on Wednesday July 12, 2023 @08:09AM (#36693362)
Yes, overloading is bad (operator overloading is a kind of overloading).
Re:C++23: The Next C++ Standard by joshuamorton on Wednesday July 12, 2023 @04:44PM (#36701398)
How do you do math without overloading? I have ints, floats, bignums, vectors, matrices, complex numbers, and potentially fractions.

You want every operation to have a distinctly named version for each other numeric type?

Maybe you can reduce some of those, but you can't really have interfaces without some overloading.

Re:C++23: The Next C++ Standard by pjmlp on Tuesday July 11, 2023 @04:27PM (#36686784)
Exactly the same thing with functions that happen to use funny characters.
Re:C++23: The Next C++ Standard by throwaway894345 on Wednesday July 12, 2023 @08:09AM (#36693356)
Nah, there’s no spooky action at a distance when you don’t overload. You know concretely what code is running.
Re:C++23: The Next C++ Standard by pjmlp on Wednesday July 12, 2023 @10:11AM (#36694827)
Have you ever heard of linkers?
Re:C++23: The Next C++ Standard by throwaway894345 on Wednesday July 12, 2023 @01:30PM (#36698320)
Have you ever heard of potatoes? Neither of them help you tell at a glance which code is being dispatched to.