News for hackers. Stuff that matters.
Re:Google Trying to Solve a UUID by zrobotics on Saturday August 06, 2022 @01:42PM (#32370065)
Umm, if you are treating them as text cells, then adding them would product 12345678 since you are concatenating strings. I just don't think there is any good solution for this, since it's effectively impossible to automatically distinguish numbers that the user wants to treat as strings (like a zip code) and numbers that should be treated as floats or ints.
Re:Google Trying to Solve a UUID by Dylan16807 on Saturday August 06, 2022 @02:30PM (#32370442)
+ 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.
Re:Google Trying to Solve a UUID by wizofaus on Saturday August 06, 2022 @04:55PM (#32371517)
Tend 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/wha..., suggests it was ALGOL-68.

Re:Google Trying to Solve a UUID by boston_clone on Saturday August 06, 2022 @03:23PM (#32370825)
the '+' operator provides concatenation of strings in both python and C; in Excel, you use '=CONCAT()'... just syntactic differences, is all.
Re:Google Trying to Solve a UUID by Dylan16807 on Saturday August 06, 2022 @04:29PM (#32371330)
It'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.

Re:Google Trying to Solve a UUID by zrobotics on Saturday August 06, 2022 @03:42PM (#32370946)
Yeah, I spend more time doing data manipulation in python than in excel, so I thought that excel would do that as well.
Re:Google Trying to Solve a UUID by wizofaus on Saturday August 06, 2022 @04:55PM (#32371521)
In C? How?
Re:Google Trying to Solve a UUID by boston_clone on Saturday August 06, 2022 @06:51PM (#32372311)
sorry, meant cpp! C (apparently) uses a function that more closely resembles Excel
Re:Google Trying to Solve a UUID by wizofaus on Saturday August 06, 2022 @09:10PM (#32372963)
C has strcat but that only does the easy part - allocating and freeing the memory is still the caller's b job.
Re:Google Trying to Solve a UUID by ineedasername on Monday August 08, 2022 @10:41AM (#32385967)
+ is not a cancatenation operator in excel. It is numeric addition. It is added the numeric values of which the letter characters are merely a representation then that answer would be the same as if excel treated them as numeric data types.

Alternatively, if you don’t want excel to perform addition on underlying numeric values but instead only on defined data types then the formula could result in NaN which would signal to the user that the explicit data type was not compatible with addition.

I know, complaining like this probably doesn’t make sense. It’s a minor issue to begin with and I’m probably an edge case as far as excel users go. It doesn’t make sense for MS to tailor its product for my type of user.