Hacker News new | past | comments | ask | show | jobs | submit login

not quite, since `a + b != b + a` feels a bit weird.



I think you missed the other thread... https://news.ycombinator.com/item?id=30081517


(a, b) would make more sense if then. Jokes aside, + also quite break the reading flows of the string such as

user_name + ": " + attr1 + "| " + attr2 + "\n"

is more difficult to parse by eyeball for me then

concat(user_name, ": ", attr1, "| ", attr2, "\n")


I mean sure, but the fact that you had to write 6 strings to illustrate this should tell you something, right?

This

  user_name + ": " + attr1
is easier to eyeball than

  concat(user_name, ": ", attr1)


To me they are similar though. I used Python quite a lot, for string concatenation, I mostly use fstrings. `+` is used mostly in the `+=` case.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: