3 ms·
> There should be one-- and preferably only one --obvious way to do it. Yeah, and then - as the language matures - so do its users. It's a common dilemma that
by qayxc 6y ago
> There should be one-- and preferably only one --obvious way to do it.
Yeah, and then - as the language matures - so do its users.
It's a common dilemma that cannot be fixed. You have the early adopters who grew up with the language and at some point got stuck in their ways (e.g. Python 2.x).
Replacing day-one features with new ones feels like using a new language to those who used the language for decades. The more mature (read: older and more widespread) a programming language becomes, the harder it is to introduce breaking changes.
String interpolation is one such area and due to the nature of the language such an important and integral part that it's becomes almost impossible to change.
As someone who never touched Python until very recently, I never even considered using anything but f-string formatting; I acknowledge that other (legacy) options exist, but outside of reading other people's code, I simply ignore them.
To new users who started with Python 3.x the obvious way to do it is f-strings and only language veterans switching to 3.x are affected by that feeling.
IMHO nothing changed. 2.x uses print without parentheses and the %-operator. 3.x requires parenthesis and prefers f-strings.