3 ms·
So we are well on our way to turning python to PHP. Edit: Sorry I was snarky, its late here. I already didn't like f-strings and t-strings just add complexity
by throwawayffffas 2y ago
So we are well on our way to turning python to PHP.
Edit: Sorry I was snarky, its late here.
I already didn't like f-strings and t-strings just add complexity to the language to fix a problem introduced by f-strings.
We really don't need more syntax for string interpolation, in my opinion string.format is the optimal. I could even live with % just because the syntax has been around for so long.
I'd rather the language team focus on more substantive stuff.
- turtledragonfly 2y ago> turning python to PHP. Why stop there? Go full Perl (: I think Python needs more quoting operators, too. Maybe qq{} qq() q// ... [I say this as someone who actually likes Perl and chuckles from afar at such Python developments. May you get there one day!]
- tdeck 2y agoQuoting operators are something I actually miss in Python whereas t-strings are something I have never wanted in 17 years of writing Python.
- nhumrich 2y agoPretty sure PHP does not have this feature. Can you give me an example?
- fshr 2y agoI believe that jab was that PHP has a bunch of ways to do similar things and Python, in their view, is turning out that way, too.
- throwawayffffas 2y agoOn a more philosophical level php is this feature. At least as it was used originally and how it's mostly used today. PHP was and is embedded in html code. If you have a look at a wordpress file you are going to see something like this: <?php ... ?><some_markup>...<? php ... ?><some_more_markup here>...
- mardifoufs 2y agoWhat's the issue with f-strings? I'm wondering because I thought they basically had no downside versus using the older alternatives. I use them so often that they are very substantive to me. If anything, this is exactly what python should be focusing on, there really isn't a lot more that they can do considering the design, expectations, and usage of python.
- throwawayffffas 2y agoIn the motivation for the t-string types, their gripe is that f-strings are not templates. My issue with them is that you have to write your syntax in the string complex expressions dictionary access and such become awkward. But, this whole thing is bike-shedding in my opinion, and I don't really care about the color of the bike shed.
- slightwinder 2y agostring.format and string substitution are bloat and annoying to use, while f-strings makes it very easy to improve readability. So in the end, they remove big complexity in usage, by adding very little and straightforward complexity in syntax.