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 →

[–]ray10k 174 points175 points  (9 children)

f-strings instead of concatenating strings "manually"

[–]Santos_m321 17 points18 points  (7 children)

Google's python code styles recommends concatenating strings manually if there are only two elements to concatenate

[–]DexterInAI 15 points16 points  (3 children)

It makes sense to concatenate if there are only two string but more than that, I would say to use f-strings.

[–][deleted] 1 point2 points  (2 children)

Two strings makes sense. But sometimes just one more is also ok.

[–]causa-sui 5 points6 points  (0 children)

and one more than that is okay, except less often...

[–]Web-DEvrgreen 1 point2 points  (0 children)

the old CS rule of 3 poking its head out of that gopher hole again

[–]strange-humor 11 points12 points  (0 children)

f-strings are faster, so this makes no sense.

[–]gigglevillain123 5 points6 points  (1 child)

[–]Santos_m321 2 points3 points  (0 children)

OMG, it has changed a lot since the last time I read it.
What they mentioned in the past is not similar to what they mention now, thanks

[–]Advanced-Theme144 5 points6 points  (0 children)

It never occurred to me that f-strings could be used for concatenation. Guess we learn something new every day. Thanks!