2 ms·
+ is not concatenation in any spreadsheet program I've seen, and it probably shouldn't be concatenation in anything. That's the solution, having a separate con
by Dylan16807 4y ago
+ is not concatenation in any spreadsheet program I've seen, and it probably shouldn't be concatenation in anything. That's the solution, having a separate concatenation operator.
- boston_clone 4y agothe '+' operator provides concatenation of strings in both python and C; in Excel, you use '=CONCAT()'... just syntactic differences, is all.
- zrobotics 4y agoYeah, I spend more time doing data manipulation in python than in excel, so I thought that excel would do that as well.
- Dylan16807 4y agoIt's not just a syntactic difference. It's a huge UX difference that one operator always does an addition on both numbers and numeric strings, and another operator always concatenates both numbers and numeric strings. The looser your typings the more it matters, and spreadsheets barely even have types.
- wizofaus 4y agoIn C? How?
- boston_clone 4y agosorry, meant cpp! C (apparently) uses a function that more closely resembles Excel
- wizofaus 4y agoC has strcat but that only does the easy part - allocating and freeing the memory is still the caller's b job.
- wizofaus 4y agoTend to agree that choice of + for string concatenation was a mistake - anyone know the history/first widely used example? Did the original BASIC have it? (I think QuickBasic did, but that's unlikely to be the origin). Edit: found https://retrocomputing.stackexchange.com/questions/20460/what-was-the-first-programming-language-to-use-for-string-concatenation https://retrocomputing.stackexchange.com/questions/20460/wha..., suggests it was ALGOL-68.