←back to thread

620 points tambourine_man | 2 comments | | HN request time: 3.833s | source
Show context
nu11ptr ◴[] No.43750542[source]
Personally, this feels like a feature that is too focused on one problem to be a general feature. Python is getting huge. When people ask me if Python is easy and simple to learn I have to say "the basics, yes, but to to learn the whole language... not so much".

I feel like in this sense Go really is interesting by rejecting almost every single feature. Honestly not sure generics were worth it as they add a lot of complexity, and while they are nice, I don't need them very much. The general idea to keep the language at its original focus is the right idea IMO. C++ would be the most extreme case where the language itself barely resembles what it started out as.

replies(4): >>43750633 #>>43750807 #>>43751386 #>>43754916 #
oliwarner ◴[] No.43750807[source]
Python has always been a batteries-included language, so having a go at templated string interpolation —a feature other languages have had for decades— seems like a strange gripe.

It's far more essential than little utilities like textwrap or goliath packages like Python's bundled tkinter implementation.

replies(2): >>43751281 #>>43754791 #
nu11ptr ◴[] No.43751281[source]
What other languages have this feature? I'm not aware of any
replies(5): >>43751420 #>>43751592 #>>43751869 #>>43752805 #>>43753962 #
jerf ◴[] No.43753962[source]
Many languages have similar features.

For instance, Python has the % operator that is a template format that allows interpolating values based on a template string with a variety of printf-like features: https://python-reference.readthedocs.io/en/latest/docs/str/f...

Also, Python has the .format method on strings, which is a template format that allows interpolating values based on a template string: https://www.geeksforgeeks.org/python-string-format-method/

As another example, Python has f-strings that are a template format that allows interpolating values based on a template string: https://www.geeksforgeeks.org/formatted-string-literals-f-st...

Also, you can also find languages like Python that have a rich ecosystem of third party templating solutions. These are often intended for things like rendering entire web pages but many of them have relatively simple ways of using their templating functionality in a fairly reasonable amount of code, if you just want to have a template format that allows interpolating values based on a template string.

So, as you can see, many other languages have this feature, as you can tell from all the examples I have shown you here.

(To spell it out for those who may find this too subtle... somehow... I'm not a fan of this simply because Python has gone from "There should be one-- and preferably only one --obvious way to do it." to "there's half-a-dozen ways to do it and if they are all wrong Python 3.x+1 will introduce a seventh" and I'm just not seeing the benefits worth the tradeoffs here.)

replies(2): >>43757581 #>>43761417 #
viccis ◴[] No.43757581[source]
What would you say is the alternative?
replies(1): >>43757737 #
1. jerf ◴[] No.43757737[source]
If I were in charge of Python, I'd probably feature-freeze it. It is already too large, but shrinking it is impractical.

Failing that, because it probably would fail, I would be raising the bar sky-high on new feature additions.

It seems like the project has actually lowered the bar in the last few versions. What was once one of my favorite languages, if not my favorite, is now a language I try to avoid, and approaching one I actively recommend against. When I'm writing it myself it's ok, but using other people's code in it is getting harder and harder, as they keep using all the features.

replies(1): >>43765452 #
2. hermitdev ◴[] No.43765452[source]
Hey, at least Python is nowhere near Perl in terms of language creep. I don't need a Period Table of Operators [0] to keep Python straight in my head.

[0] https://www.ozonehouse.com/mark/periodic/