Give 1 (one) good reason not to have operator overloading in your language.
>Hardmode
Shitty developers don't count.
Why not a single method that handles all types of input by itself? If that's actually needed?
>>59619675
Becausesubtract(add(a, b), mul(c, d))
Isn't as readable asa + b - c * d
Clarity maybe. A function might be clearer whereas stumbling upon an overloaded operator while reading some code could throw you off and might send you inspecting a completely different part of the code to understand (or make sure) how it works behind the scenes.
But I'm a shitty developer so I don't really know.
Order of operations brings in complexity in both design and implementation of the language.
(LISPs solve this problem with prefix everything)
>>59619825
If you are overloading operators to perform operations that are not immediately recognisable as some obvious add/subtract/index etc. analogue then you're just a shitty developer writing shitty code.
>>59619872
So removing operator overloading completely from the language could potentially make your life easier when you're working with shitty programmers.
Good programmers being pretty rare I think this is a good argument against operator overloading. Of course this is meaningless if you only work with talented people or alone.
>>59619924
Might as well not even have inheritance or OOP in general if you're worried about shitty developers abusing useful features.
>>59619646
I have never overloaded an operator in my life even tho the languages I use have it. What kind of weird abstraction are you working with that can't be done better with better use of generics and functions? I have never wanted to overload types that don't already support arithmetic operation by default.
>>59620008
>I have never worked with arithmetic types that aren't primitives
Maybe one day you'll meet a vector or an arbitrary-precision real.
>>59619957
Then may as well remove variable names and just use cells like in brainfuck since they may use shitty variable names. May as well use opcodes instead of user defined functions since they may make ones that are innefficient and don't make sense.
No matter how many useful tools you take away because they can be abused you will still have capacity left for shitty programmers to be shitty.
>>59620086
Exactly. So why remove something as useful as overloading?
>>59619646
It's harmful as FUCK
how is"string" + "string"intuitive at all? It's a string, not a number
also bad for performance reasons
only nu males working on meme langs like op overloading because they have zero regard for code correctness or performance in the first place
What programming languages should do is support basic arithmetic on vectors or bignums but not have operation overloading. Then all these retard would have literally no arguments for operation overloading.
>>59620277
OP here, I'm satisfied with that. Anyone trying to overload +-*/ on non-numeric types is a shitter.
>>59620257
>also bad for performance reasons
How so?
>>59620036
Why would I not import a library to handle that?
I like php.
$var=1; //not it is an int
$var.="Result: ".$var; //and now a string
echo $var; //'Result: 1'
$var="2"; //now it is a string
$var+=1;
echo $var; //3 //and now it is an int or a string, anyways, you get "3"
I wish other languages did this. If I expect an int I just intval() anything. Everything else is used as a string.
>>59621831
That's automatic type conversion. That's different.
>>59619646
Language features implicit type coercion instead.
>>59619646
there's none
>>59619646
It's only really useful for vector/matrix arithmetic.
You're much better off using macros/inline functions than abusing the same characters to mean multiple things.
You can't use nested <> operators in C++ without being misunderstood as stream operators.
>>59623341
Or just add spaces, cretin.
>>59621831
This isn't operator overloading you nerd
>>59619646
>1 (one)
stopped reading right there
go outside you filthy autist
>>59623444
>significant whitespace
AAAAAAAAAAAAAAAA
>>59624775
>x + = 2doesn't compile
hurf durf muh significant whitespace
>>59624815
This used to work in old versions of C because += was treated as 2 tokens and not as a single operator.
>>59619646
Because my language is SHITE
My language has no operators!
>>59619646
Because there are about 5 people in the world who know anything about REGEX editing, and you're not one of them.
>>59619646
operators and keywords have a fixed meaning within the programming community. Its how we learn to communicate each others ideas at the high end level.
If you give every programmer their own scripting langauge nobody is going to be able to communicate, it will be like the Tower of Babylon or the Fall of Rome.
Of course, nothing is preventing you from scripting your own babylonian langauge using scripting from an incan monkey god if you wish.
I hear plenty of people speak esperonto.
>>59625770
>scripting from an incan monkey god
>scripting using heiroglyphics from an incan monkey god
>scripting using heiroglyphics from an incan monkey god that visited you during a insomnia and caffiene induced dream vision
>scripting using heiroglyphics from an incan monkey god that visited you during a insomnia and caffiene induced dream vision whering you defeated the monkey king and used his staff of infinite variable length to level out the milky way
>>59625804
I'm never playing "telephone" with you ever again.
Purple Monkey Dishwasher.
>tfw swift codebase
>Operators like × ∈ etc
It's truly why tier.
>>59625913
is swift the new fortran?
can it be used outside of theoretical excersizes?
Implying you should use operator overloading
CAPTCHA> SELF centre