4 ms·
The problem with modern Python is that it's trying to recreate C# or Java. Which leaves it with nothing, because it'll only end up an inferior version of the la
by BuckRogers 7y ago
The problem with modern Python is that it's trying to recreate C# or Java. Which leaves it with nothing, because it'll only end up an inferior version of the languages/platforms of which it's attempting to duplicate.
When I was into Python, I liked it because it was a tighter, more to the basics language. Not having 4 ways to format strings and so forth.
I don't think Python can defeat Java by becoming Java. It'll lose there due to multiple disadvantages. The way Python "wins" (as much as it could at least), is focusing on "less is more". They abandoned that a while ago.
My vision of a language like Python would be only 1-way to do things, and in the event someone wants to add a 2nd way, a vote is taken. The syntax is changed, and the old bytecode interpreter handles old scripts, and scripts written with the latest interpreter's bytecode only allows the new syntax. For me that's the joy of Python.
I think a lot of people wanted Python's original vision, "one way to do things". If I want feature soup, I'll use what I program in daily. Which I do want feature soup by the way, I just have no need to replace it with another "feature soup" language like Python turned into because it's inferior on technical and for me, stylistic levels.
- orangecat 7y agoMy vision of a language like Python would be only 1-way to do things, and in the event someone wants to add a 2nd way, a vote is taken. By that standard, the walrus operator is not only acceptable but essential. Right now there are at least 3 ways to process data from a non-iterator: # 1: loop condition obscures what you're actually testing while True: data = read_data() if not data: break process(data) # 2: 7 lines and a stray variable done = False while not done: data = read_data() if data: process(data) else: done = True # 3: duplicated read_data call data = read_data() while data: process(data) data = read_data() There's too many options here, and it's annoying for readers to have to parse the code and determine its actual purpose. Clearly we need to replace all of those with: while (data := read_data()): process(data) Yes, I'm being a bit snarky, but the point is that there is never just one way to do something. That's why the Zen of Python specifically says one "obvious" way, and the walrus operator creates an obvious way in several scenarios where none exist today.
- BuckRogers 7y agoI have no opinion on this new feature, so I can't really engage in that debate over it. I still see no reason for smaller languages like Python to not operate as a true direct democracy. There's clearly frustration over the leadership in the PSF, so much so that Guido capitulated under the stress.
- ptx 7y agoThe Zen of Python says that there should preferably be one obvious way to do it, not always strictly only one way. Also, this motto should be interpreted in the appropriate historical context – as taking a position in relation to that of Perl, which was dominant when Python was gaining popularity and had the motto "there's more than one way to do it".