Live data from Hacker News

Python Is Eating the World

zdnet.com

971–980 of 993 posts

Re: Python Is Eating the World

#971

Earlier quoted context omitted.

The fact that there's more than one way to do things in Python is why i've found it so easy and flexible, I have no idea why that goober put this motto in the zen

It's general design guideline and I like Zen of python PEP-20. Explicit is better than implicit and most packaging system in python are explicit which I like. Been using it for over 15 years after perl and been happy with it. Nothing to complaint as every language has their own set of good and bad. This is what makes it interesting, there is always a room to improve and make things better.

I think they could learn a lot from Rust, which has a very usable, clearly defined way of listing and making dependencies. You can decide how you want to handle individual dependencies (version number, version range, git commit hash, wildcard, etc). I'm not sure how binary dependencies work (i.e. something from your system's package manager), but I've used projects that use them, so the problem is solvable.

Python has always stood out for me as a particularly odd way of doing it. It feels a bit like more like C, but with a package manager that's not quite as nice as other scripting languages have.

Re: Python Is Eating the World

#972

Earlier quoted context omitted.

I have a hard time reasoning about multiprocessing code, for various reasons. It's bitten me in a lot of weird, distinct ways, not really worth listing here. To communicate across mp you use pickle, which is a pretty significant performance impact relative to something like threading. There's also the issue of copy on write memory + reference counting interacting poorly.

> To communicate across mp you use pickle I suspect this is the root cause of the difference in our experiences. My uses of mp have usually been somewhat more "embarrassingly parallel", for instance having a list of data elements which need to be processed with the same algorithm. For this use case, the usage of mp is pretty simple, often only a `pool.map(f, xs)`. I can imagine that pickle might have tricky edge case…

Sure, but:

a) All reference counts after the fork are going to cause a copy of memory, so any memory access (even a read) can trigger a copy.

b) Even to send 'xs' over you must serialize it via pickle, and then the callee must deserialize it

That may be fine for your use case but it's strictly worse than just sharing a reference across a thread.

Re: Python Is Eating the World

#973
post #33

Python has a lot of problems that really slow down development, but they are all fixable. The biggest issue, in my opinion, is in dependency management. Python has a horrible dependency management system, from top-to-bottom. Why do I need to make a "virtual environment" to have separate dependencies, and then source it my shell? Why do I need to manually add version numbers to a file? Why isn't there any builtin way…

> Why isn't there a builtin way to create a redistributable executable with all my dependencies?

There is and it's called docker. The other issues could indeed be fixed with something like poetry.

Re: Python Is Eating the World

#974

Earlier quoted context omitted.

> Python leaves it open how you do it Are you saying “There’s more than one way to do it”?

The fact that there's more than one way to do things in Python is why i've found it so easy and flexible, I have no idea why that goober put this motto in the zen

It's from the days when Perl was Python's main rival (the late 90s / early 00s). Perl has complex syntax and the"there's more than one way to do it" motto. Syntactically, and especially in early Python, there were fewer ways of doing things than in Perl and Python people saw that as a positive.

Re: Python Is Eating the World

#975

Holy Crap! What a lot of irrational, hyperbolic hate for Python. I think everybody should spend their first couple of years working in Fortran IV on IBM TSO/ISPF. No dependency management because you had to write everything yourself. Or maybe [edit: early 90's] C or C++ development where dependency management meant getting packages off a Usenet archive, uudecoding and compiling them yourself after tweaking the config…

Why do you think that Python should be compared to Fortran? Why not Rust or Julia? If we compared everything to worse humanity would not progress at all. I have spent 10 years on Python and I sympathize with some of the criticism below here pretty much. I wish Rust or Julia will replace it for data crunching soon.

Fortran is not worse. Far better than what you think is, really. Just try Fortran 2018 standard and you will see.

Re: Python Is Eating the World

#976
post #571

Earlier quoted context omitted.

I had to learn Fortran IV for my first job. Am I allowed to hate Python? Are you assuming everyone complaining here is young, and this is their first language? Consider that maybe they're complaining because they've used older languages they liked more. Often, not having a feature is preferable to having a feature designed or implemented poorly.

There's a difference between hating Python, and saying (I'm guessing is the comment that spurred this one) this: "I try to be a good sport about it, but every time I write python I want to quit software engineering.", like a top-level comment below says. If you had to write Python, would you also want to quit software engineering? Would you go back to Fortran instead of Python? Of course you're allowed to hate Python…

In my opinion, as a computational researcher, Python was not really meant to be a Scientific Computing Programming environment. It was a big historical mistake to go in that direction. In the near future, hopefully, it will be replaced, by a better alternative. and believe me, for most people who do not speak highly of Fortran, when it comes to developing a new language for scientific computing, they pretty-much end up reinventing Fortran.

Re: Python Is Eating the World

#977
post #792

Earlier quoted context omitted.

Python and Lisps do directly compete as the preferred introductory language for university computer science classes.

In this decade? Not even MIT teaches lisp anymore.

Yep. https://github.com/racket/racket/wiki/Courses-using-Racket

Lots of universities teach Scheme, particularly Racket. Although Python is more popular, even in that domain.

Re: Python Is Eating the World

#978

Reading this got me thinking and I wonder if other people feel like me about this, so I'm going to share it. This is not serious, but not entirely unserious... I try to be a good sport about it, but every time I write python I want to quit software engineering. It makes me angry how little it values my time. It does little for my soured disposition that folks then vehemently lecture me about the hours saved by future…

> and that infernal pep-8 linter insisting 80 characters is a sensible standard in 2019 I don't know why 80 characters is a problem. I don't use the linter but I enforce this rule religiously with a couple of exceptions (long strings comes to mind). It forces me to think heavily about the structure of the code I'm writing. If I'm nesting so deeply, something has gone wrong. If I've got a ton of chained methods or rea…

All I know is that with 80-char width I can have 2 files side-by-side on a 15" MBP along with the dir-tree on the left in an editor like PyCharm or VSCode and fully see both files wo wrapping. It helps my productivity immensely.

Same deal when it comes to reviewing PRs in GitHub. Wrapping just interrupts flow for me.

Re: Python Is Eating the World

#979

Earlier quoted context omitted.

> and that infernal pep-8 linter insisting 80 characters is a sensible standard in 2019 I don't know why 80 characters is a problem. I don't use the linter but I enforce this rule religiously with a couple of exceptions (long strings comes to mind). It forces me to think heavily about the structure of the code I'm writing. If I'm nesting so deeply, something has gone wrong. If I've got a ton of chained methods or rea…

It's also awesome if you have to do code reviews on a laptop or don't have a massive screen available. That said, we usually just go with autoformatting via black, which is 120 by default. No more hassle manually formatting code to be pep8-compliant. Just have black run as a commit hook, which is super easy via pre-commit [0]. And you can run the pre-commit checks during CI to catch situations where somebody forgot t…

While initially resistant I've come around on Black for our team and a failed Black check will now make a CI build fail for all our projects.

We're still using the community edition of SonarQube [0] for inspection but Black finally did away with the constant bikeshedding over formatting minutia, seems like it's saving us tons of time.

[0] https://www.sonarqube.org/

Re: Python Is Eating the World

#980

Earlier quoted context omitted.

A lot of stuff powered "by Python" is in practice powered by multi-language infrastructures, which can be pretty complex. For example, the Python ecosystem for data science is mostly implemented under the hood in a mix of C, C++, and Fortran, with high-level Python bindings, due to a mixture of legacy reasons and pure Python being too slow. Obviously lots of people still like the end result, but saying this kind of s…

Python is eating the world, just not digesting it.

Python has already eaten the world — it's just not very evenly digested.
Post reply on HN