Many reasonably modern programming languages (Java, Python, C++, Ruby) use + to represent string concatenation. "A" + "B" is the string "AB".
Languages with a more mathematical background tend to use other operators for this (Haskell uses the monoid operator <> or the list-specific operator ++, Julia uses *), and some languages with non-C heritage also seem to have diverged from this trend (Elixir uses <>, Perl uses ., Lua uses ..).
What was the first programming language to use + to represent string concatenation? That is, what is the first programming language where it would be idiomatic for me to take two variables a and b containing strings and write a + b, expecting to get something reasonable out of it? I realize C++ predates (and directly influenced) all of the examples I gave above. Did C++ start this trend, or did it borrow the idea from its own predecessors?
+notation overly verbose. I prefer SNOBOL/Spitbol where string concatenation is done by the⎵character (that is, whitespace) which you needed to have anyway to separate symbols ... (i.e., juxtaposition leads to concatenation). Among the many improvements to C++ operator overloading I would like would be not just user-defined operator symbols but being able to defineoperator" " ()(to be distinguished fromoperator""() _suffix_...). – davidbak Jul 21 '21 at 18:18+is still super magic in Java, and is the only operator to work on any non-primitive types. – Silvio Mayolo Jul 22 '21 at 18:20==and!=operators are also overloaded for primitive-primitive and reference-reference operations, but unfortunately not for primitive-reference or reference-primitive operations (which, if allowed, should report equality if the reference identifies a boxed value which equals the primitive, and inequality otherwise). – supercat Jul 22 '21 at 20:42-is overloaded forbyte,char,short,int,long,float, anddouble, for example. (And arguably, fornull, too.) In fact, most operators in Java have probably at least half a dozen overloads. Which is ironic, considering that the standard answer given to the question why Java doesn't allow programmers to overload operators is that "operator overloading is evil". – Jörg W Mittag Jul 24 '21 at 08:51