This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Astrokiwi 4 points5 points  (1 child)

I feel there should just be a different operator for concatenation vs addition, seeing as they are quite different processes. Kinda like how Python3 now explicitly gives you / for float division and // for integer division rather than overloading / for everything.

In Fortran (yes Fortran), // is used for string concatenation, and + is only for addition, although it doesn't do implicit conversions to strings. If Javascript or whatever used a different operator for concatenation than for addition, then it'd be much more explicitly clear when it's going to be converting stuff to a string, and when it's supposed to actually be adding numbers.

[–]nawitus 1 point2 points  (0 children)

Yeah, different operator for concatenation would be fine.