Live data from Hacker News

Breaking up with Python

cedwards.xyz

141–150 of 179 posts

Re: Breaking up with Python

#141
post #34

Pretty amazing success for the Python standard library to be labeled as barebones.

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…

> The type annotations never took off

I don’t think that’s true; I think that type annotations have been seeing significant gains in usage in Python in recent years.

Re: Breaking up with Python

#142
post #18

> Python’s documentation sucks I can't agree with this. I have always had a very good experience with python documentation. One can use the built-in "help" function which works seamlessly with the docstring feature of the language. The complaint in the blog post seems to refer to the UI of the website missing a table of contents for functions. Yeah sure they could add that but I don't see it as a big point. > Python’…

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 appear in search engine results for relevant keywords leading to spending several minutes brute force searching the official docs site to find something that should have been a 10 second search. Perhaps the most obvious comparison is with the JavaScript/TypeScript world, which has embraced both types and different kinds of documentation and as a result gives a much better developer experience in those areas today.

The standard library in Python is strange because it has a lot of content but much of that content just isn't very good. Entire packages in the standard library are largely ignored in favour of some de facto standard package from PyPI that does the same job much better. Some of the packages for working with different protocols and file formats are useful in the right circumstances but they're so slow that they're not suitable for many applications and again you end up pulling in a better alternative. Meanwhile common data structures and algorithms that you might look for in any modern language's toolbox are scarce to non-existent and the ones that do exist don't always compose easily.

Re: Breaking up with Python

#143
post #11

Earlier quoted context omitted.

I often find myself typing python3 import some_module dir(some_module) rather than trying to find functionality on the docs sites anymore

If you haven't already or aren't aware, install IPython, use ipython3 as a replacement REPL and use the '?' or '??' operators to open the docs/definitions of the object you want to inspect. ipython3 import some_module some_module? # or some_module?? You can also type the object's name and hit tab to get a drop-down menu that will list its methods and attributes, like dir() with a better UX. Modules are objects, too.

> If you haven’t already or aren’t aware, install IPython, use ipython3 as a replacement REPL and use the ‘?’ or ‘??’ operators to open the docs/definitions of the object you want to inspect.

you can read the docs in the standard REPL with help(object).

And, of course, IDEs (or editors with decent Python support plugins) will do it on hover.

Re: Breaking up with Python

#144

I don't disagree with any of his points, actually, and agree with almost all of them. The standard library has some holes - though I think that's true everywhere. I don't know that eg Ruby or java don't have holes either. I do think the packaging Story in python is nuts. Why does gem just work for Ruby but python's story is such a disaster? Though imo my modern advice is "just use poetry and ignore everything else".…

> The standard library has some holes - though I think that’s true everywhere. I don’t know that eg Ruby or java don’t have holes either.

Ruby has been actively stripping the stdlib, moving libraries to default and bundled gems.

Re: Breaking up with Python

#145
post #72
post #57

Earlier quoted context omitted.

On other hand that is often the part of documentation with Python I would love to have. And for a while I have missed with many python things.

Python doc peaked for me with the 1.x “library index to keep under your pillow” https://docs.python.org/release/1.5.2/lib/lib.html

> Python doc peaked for me with the 1.x “library index to keep under your pillow”

I can see why that’s nice, but I find it odd to be described as a peak. While the details of the standard library it documents have evolved, I don’t see how the current version (linked from the main docs site with the same “keep this under your pillow” line) of the same portion of the docs is any worse:

https://docs.python.org/3/library/index.html

Re: Breaking up with Python

#146
post #69

I tried python in 2010 because looks easy, but Go came on stage, and changed backed tools. Go is the way to better backend, CPU and memory optimized. I read an article that Dropbox save thousands just by change from Python to Go. It's difficult, especially handling shared variables in go routines, but it's worth it.

I'm not sure go should be compared to python as they are designed for very different things. Go is more fairly compared against modern c++ or rust in my mind. Python is not designed to be lightweight or fast (although it has been consistently improving with each release) but favors expressability and run time flexibility instead.

> I’m not sure go should be compared to python as they are designed for very different things.

Go was pretty expressly aimed at the spot where, at the time, Python was seen as too inefficient but C++ was seen as too much complexity.

Re: Breaking up with Python

#147
Every language that's been around long enough has issues. Python has its own of course, and the ones the OP listed are real. But none of them are show-stoppers or as big a deal as to stop coding in Python.

Here is my take on what the OP is actually trying to say: "I don't want to code in Python any more (because there are newer cooler languages like Go?) and here is my list of reasons for rationalizing my rather irrational decision"

Re: Breaking up with Python

#149

Earlier quoted context omitted.

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'd like to see the receipts on your statement. Easy examples I use every day: ML and Quantum Computing libraries. There is a depth to the Python ecosystem that can't be matched anywhere else. Honestly, I'm sure I will get a ton of flack for this, but I really dislike Python. I use it every day and have for years and not only has it failed to grow on me (like most languages do), I've learned to dislike it more with e…

Those are really exceptions because researchers love Python. Outside of those areas, there's really nothing special that Python's ecosystem brings to the table.

I'd really like to see machine learning stuff in languages other than Python so that there's less friction in experimenting. I know that would require prying it from researchers' cold dead hands though.

Re: Breaking up with Python

#150

Earlier quoted context omitted.

a) thats only for modules designed to interact with Windows features . Sure, Get-ADComputer doesn't work on Linux, but... by default Python doesn't work with a ton of things which are available through the wast library of Python modules . Same deal with PS, you can't interact with Snipe-it or Netbox by deaful... but there are modules for that.[0] Basics works everywhere. In my personal experience I often found myself…

I appreciate the response; as I say, YMMV. I did feel a little misunderstood at the end of that response, though, so I'll clarify. > explicitly stating things you don't kno2 or understand I've done Windows development since 3.1 (and .Net since 2001) so in that time I've written a lot of PowerShell. I'm not offering uninformed second-hand opinions. For (a) I'd argue that the lack of adoption outside Windows makes it d…

> lack of adoption outside Windows makes it de-facto not really a transferrable skill

If you want to only write/use PS - then probably, but... if this is yours environment - you chose the tools, if it's not - the overall concepts and workflow doesn't differs too much, especially for Python.

I had an unpleasant experience of rewriting a Python 2 script to Python 3. At some point I just said "fuck it" and rewrote it, from scratch, on Linux, with .NET SNMP library - and I got a working script in an hour, compared to 3 days of headache with a known good Py2 script which I only needed to adapt to Py3.

The difference was in the quirks of Python (especially on strong typing and indentation), not in the program flow.

Later I finished rewriting it in Py3 but the overall experience of writing in Python left a sour taste.

A person who would start with PS could easily adapt to Python (or honestly any other language) if he would understand how the things work - and PS allows, IMNSHO, that in a quick and easy way.

But if someone just copy-paste the code from SE - does it matters if that happens in Python or PS?

> so what if it is easy to autocomplete? It doesn't make it any less ugly/verbose

LOL, "I need a PL what is easy for a beginner, so I would NOT recommend an explicitly verbose language for that!"?

a) easiness of autocomplete allows the discoverability of the options. Just a simple Ctrl+Space offers all the options of a cmdlet (conveniently listing them with the precedence used by the author, leaving all the automatic shit added by cmdletbinding() at the end) and this alone helps tremendously with writing. I don't keep all the things, options and parameters in my head (and I don't want to) and a beginner doesn't know them in the first place.

Most of the time I just write something and see if the are means to do what I want through the autocompletion of parameters and cmdlets. If I don't see the appropriate things or they don't work as I expect them to work - only then I consult with manual. If in your opinion nobody should write a single LOC without a couple of hours in the docs...

b) I often hear about how the verboseness of PS as bad thing, but... honestly, IMO, it doesn't matter, it's not THAT verbose as Java, it's not full of obscure and senseless abbreviations and names (especially compared to Linux CLI) and if you compare the actual similar code.. it's not that big difference in LOC and line length. Oh, and you don't reinvent the wheel each time you need to have a working help and argument parsing *smirk*.

c) are we still on the "PL for a beginner" topic? For a carpenter microscope is just a very bad hammer.

> difference of opinion

Let's get back to "PL for a beginner". Between Python and PS the latter would win just because it has a better IDE/autocomplete and has automagik on a lot of things what would drive a beginner mad in Python (oh god, just calling an external binary and capturing it's output...)

PS, as an anecdata: I have a friend who can write some Java, for util level things. I've seen his PS code - he treats PS as a full fledged PL (which again - isn't a bad thing, just not the best way to spend your time writing PS scripts). I doubt he wrote anything in Python, but of what I saw in his PS code means he would have no problems (well, except strong typing and indentation, LOL) writing something in Python.

Post reply on HN