4 ms·
F-strings have been the fastest ever adopted syntax change to Python, and is the overall most popular of the recent post-3.6 additions. That’s Python, but it sh
by orf 3y ago
F-strings have been the fastest ever adopted syntax change to Python, and is the overall most popular of the recent post-3.6 additions. That’s Python, but it shares similarities with Java in terms of numerous different ways of formatting strings.
They are very, very useful, but lots of people said similar things to you about not getting it. Then… they used them, I guess. \{} is not very verbose either, and the use of generic formatters is a really nice addition.
- rf15 3y agoI'm always happy to have stuff like f-strings in languages. This on the other hand feels much too overladen with separate requirements of safety/etc. which reduces its general usability. Suddenly you don't have to prefix it with "f" / "{}" but "STR." and "\{}", which (unlike f-strings) keeps cluttering your reading space more, something you actually try to improve on with this very feature in other languages. Neither the prefix nor the curly braces are optional for simple terms sadly, unlike in some other languages.