|
|
|
|
|
by smugworth
2587 days ago
|
|
I love F-strings, my only gripe is the chosen syntax for invoking them.
For starters, F may or may not be capitalized, so these two lines are identical. F"My string with {interpolated_value}"
f'My string with {interpolated_value}'
Like using apostrophes or quotation marks to enclose strings (or F-strings), I find myself wasting time questioning the trivial notion of whether to capitalize or not.I think Groovy's syntax is great, where quotation marks denote an interpolated string, and apostrophes denote a plain old string. "This is my ${interpolated_value} string"
'This is my plain old string'
But these are nitpicks, and it's really too late to implement something like that. |
|
That's Perl's syntax, from about 15 years before Groovy, whippersnapper. Off my lawn, now.