Earlier quoted context omitted.
Maybe they shouldn't be using Notepad.
err, they were using IDLE.
https://docs.python.org/3/library/idle.html#automatic-indent...
171–179 of 179 posts
Earlier quoted context omitted.
Maybe they shouldn't be using Notepad.
err, they were using IDLE.
https://docs.python.org/3/library/idle.html#automatic-indent...
What is such low effort post doing here? I use Python way less than I used to, but this is just unfounded whining. And imagining js is better on those points... omfg.
Just for the record, I'm the author and didn't post it to HN specifically because it's opinionated and whiny.
Earlier quoted context omitted.
err, they were using IDLE.
Then they should have spent some minutes reading documentation on how to use their tooling, https://docs.python.org/3/library/idle.html#automatic-indent...
Earlier quoted context omitted.
Then they should have spent some minutes reading documentation on how to use their tooling, https://docs.python.org/3/library/idle.html#automatic-indent...
The docs you linked say that IDLE can help with indentation, not reindent code for you. This might surprise you, but students don't necessarily know how to preserve indentation or reindent code as they cut/paste around.
So not even you are reading the documentation?
And if IDLE is not good enough for students, Komodo IDE exists for 20 years, VS and VSCode also do a quite good job, PyCharm, as do Emacs and vim.
It isn't as if the alternative JavaScript and Go code is being written without adequate tooling.
Earlier quoted context omitted.
I have to agree. I have a lot of gripes with Python, but the documentation and the standard library are generally great. The author favors Javascript while deriding Python for its syntax, type-hints, and standard library, and favors Go while deriding a Python Docker image's size and documentation. I feel like the author must use Python in a very different way than I do for Javascript and Go to be the winners in these…
I have a lot of gripes with Python, but the documentation and the standard library are generally great. It depends what you're comparing them against. Python's style of documentation - for the language itself and for many of the popular libraries that follow the same style - is mostly reference material and often incomplete. It's very lacking in examples of usage. It almost completely ignores types. It often doesn't…
I also agree with you on typing, searchability, and the problem of standards vs defacto standards. (The page for `urllib.request` points you to `requests`, which is good! But the page for `array` has a link to `numpy` only at the very bottom.) I also don't have the JS/TS experience to compare against, but I believe you there. (The MDN alone is excellent.)
I think my experience is biased from spending a lot of time in deep learning. (Keras and Pytorch have a bit of a competition for having good docs). The adjacent libraries, like Numpy or Pandas or stdlib like `socket`, have also been good in my experience. (Perhaps these benefit from having relatively 'obvious' types for most functions. One might infer the types and dimensions of `numpy.matmul(x1, x2)` easily, whereas I have no idea what the types of the args in `Request.set_proxy(host, type)` are.)
It's a shame this post was flagged, because I've had a lot of blind spots uncovered in this thread!
People joke that Python programming is 'pip install solution', but it's honestly not too far from the truth. Until Go, Rust, or whatever fancy new language can match the wealth of well maintained libraries that Python has, I don't see it ever getting replaced for the quick scripting that the author talks about.
Author here. The Go ecosystem is extremely rich. Are you familiar with it? I would say it is at least as rich as Python's, if not more.
I've been recommending Python to the occasional aspirational young programmer. Is it already passé? What would you recommend instead for a starter language? Looking for beginner-friendliness, widespread use, and longevity. edit: to be clear, I hope this won't devolve into a language flamewar. I'm sincerely interested in other devs' opinions, and hoping that either Python is still a good recommendation (which seems to…
Python is syntactically simple but that doesn't necessarily make it a good choice for beginners. I've seen students spend hours wrestling the interpreter over whitespace issues.
Earlier quoted context omitted.
Yeah, but the author is comparing it to JavaScript. How is the tooling less of a mess in JavaScript?
I am the author. npm/yarn are pretty much the defacto package managers for JS, so that's one less nightmare to deal with. But I never really said that the tooling is better in the JS ecosystem. The better performance is just enough to tip the scales in favor of it.
But JavaScript is in no way different in this regard: Bit, Yarn, PNPM, Turbo, NX, Rush. If anything, JS has more tooling chaos than Python. And don't get me started on webpack and all its alternatives. And then there is the repository chaos, umpteen abandoned packages, repeated instances of malware injection (which has also happened in the cheeseshop, I know, but not nearly as often).
In the end, you choose a tool, and use it until you decide there is a better tool, and you get to work. I used to use only pip and venv. For a while I used virtualenvwrapper. Now I use Poetry with asdf, and it is a very pleasant experience.
The better JavaScript performance doesn't matter in 90% of use cases. In nearly every real-world bottleneck, the answer is not to switch ecosystems, but to optimize. How much traction has JS gotten in workloads where numpy and tensorflow rule the roost?
And you don't like Python's syntax. That's your prerogative. I love it, and so do millions of other python devs.
Earlier quoted context omitted.
Yeah, that caught me off-guard, too. I agree, though, the urllib module that he links to it's not the best thing ever when it comes to Python, and I say that as a guy who has written Python code for a living for 17 years now. But other than that I find the standard library more than ok. The only thing that I can agree on is the slowness, but even that is relative, as we're not all writing speed-critical code. The typ…
Disagree on typing. Modern types, as evidenced by typescript, are very helpful and don’t incur significant verbosity cost. They are expensive in large projects during linting. My personal recommendation is to use typing and mypy in all new code, coming from somebody who was celebrating new-style classes in 2.2.
Typing with mypy during development never quite cut it because it's optional (unlike e.g. Typescript), and the editor support just didn't quite make it effortless the way VSCode/Pylance did. (I'm talking about development, not CI.)