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_
...).