Live data from Hacker News

Python Is Eating the World

zdnet.com

401–410 of 993 posts

Re: Python Is Eating the World

#401
post #383

Earlier quoted context omitted.

> Particularly the lack of braces Since most of my professional experience is with C like syntax languages, I don't get how the lack of braces is an advantages, quite the opposite in my limited experience with Python. Braces define scope unequivocally, they are easy to visually parse and don't care whether you are using tabs or spaces or even if you, loud gasp, mix them. Furthermore, you can copy and paste, say for l…

Absolutely agree. maybe its just cos I am coming from languages with braces (java) but yeah I find the lack of braces + whitespace having meaning (tabs versus spaces for example) _incredibly_ frustrating I also don't like the fact it is dynamically typed. It makes reading soure code so much harder. E.g What is the type of this thing that is being passed as a function arg?

> I also don't like the fact it is dynamically typed. It makes reading soure code so much harder. E.g What is the type of this thing that is being passed as a function arg?

I didn't want to get into that as it always seems to open a massive can of worms but agree 100% with you.

I need all the help I can get when developing, to throw away all the type checking that the compiler does before runtime seems like developing with a hand tied behind one's back, but each to their own, far be it from me to try to convince somebody that they should switch languages: if Python works for you, then great, keep using it.

Re: Python Is Eating the World

#402

Earlier quoted context omitted.

Is there a model dependency management system for some other language that addresses all these issues? Dependency hell is everywhere.

Rust's cargo, JS's yarn and the grand daddy of them all Ruby's bundler address all these issues. Even newer versions of Gradle support a workflow where you specify the versions you know you want and just on everything else, including transitive dependencies, down.

Python's Poetry also addresses these issues.

Re: Python Is Eating the World

#403

Earlier quoted context omitted.

I work at the same place you do. I code often enough from my macbook, using likely the same tools that you use, and they're truly painful with >80 character lines. I don't understand how Go and Java devs survive. I also don't think an 80 character line limit is a bad thing: small well defined functions that do only one thing are good. Long lines often encourage people to want to nest code deeply (which is terrible!)…

Java dev here. I would try and defend a 120 character limit but I have a 34" 5k widescreen monitor so I probably don't have a leg to stand on. I'm writing a mix of Java and python at the moment. Python for lambdas behind an API gateway and Java on some containers for stuff that's more complex but evolves more slowly. It's neither python or Java where I'm really spending my time though. It's CloudFormation, Ansible, J…

> I feel like programming languages are the easy bit these days.

Agreed. The mainstream garbage-collected languages are all basically the same in the grand scheme of things. The work that takes most of my time (and growing) lately is packaging, testing, deployment, etc.

Re: Python Is Eating the World

#404
post #102

Earlier quoted context omitted.

It seems to value my time quite highly, as I can achieve most things more quickly and easily in Python than any other language I know. Can you be more specific about how it increases your burnout? Is it the language, or someone forcing you to use that linter and settings?

I'm not the person you're responding to but what they say resonates with me as a Python developer. I believe Python is quite possibly the best language for a few things * Exploratory programming - such as what data scientists do * Writing programs that will never grow beyond 150LOC, or roughly what fits on a screen + one page down When I have those two constraints met I am almost always choosing Python. Here are some…

Data scientist here. It’s great because non programmers find it easy and we have so so many tools available.

That said, the amount of cpu cycles wasted even with best of breed pandas is insane, and when you want to do something “pythonic” on big data it all falls down. When you want to deploy that model you are also going to have problems.

That said, it’s still the best tool for the job, but it’s certainly not because of the creators of Python.

Re: Python Is Eating the World

#405

Earlier quoted context omitted.

Python is uniquely ill-suited for dependency management compared to many other languages. For some reason dependencies are installed into the interpreter itself (I know what I just said is very imprecise/inaccurate but I think it gets the point across). In JS, which also has a single interpreter installed across the system (or multiple if you use nvm), the packages aren't installed "directly" into the interpreter, wh…

Not trying to defend Python, but it's not hard to make it work like JS without virtualenv: pip install -r requirements.txt --target=python_modules Then to run: PYTHONPATH=python_modules python myscript.py This will keep all the dependencies in the local "python_modules" directory. I've used this on a custom SaaS platform, and it worked quite well.

Also, that's more or less what virtualenv does. It would be nice if this was default, but IIRC it's coming.

Re: Python Is Eating the World

#406
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…

The solution to this is Poetry. https://poetry.eustace.io It's good. Projects should use it.

NO THANKS

Re: Python Is Eating the World

#407

The part that Python really bothers me, as someone who had write Python for almost 10 years, and right now doing it professionally, though personally I don't consider myself a Python developer rather than a Python senior user, is actually obvious to nail down, and frustratingly, difficult to handle. SLOW. The sin of all. I don't want to make other arguments with people who just come to repeat 'Oh you can make it fast…

Same here. I've used Python daily or almost daily for the last ~10 years (thankfully I've used other languages too). I've architected reliable systems on top of it but it was obvious to me almost from the get-go that Python is a terrible language. I credit my previous years of programming in Lisp that trained my mind to see through the Python mirage. One issue is that veneer of Python user friendliness that lures peo…

I honestly think you've just worked on bad projects. Python isn't the perfect language but the quality of the available libraries makes it awesome. The individual quality of projects in any language will always vary.

Re: Python Is Eating the World

#408
post #24
post #14

Earlier quoted context omitted.

Here's a simple but less-than-completely-documented way to keep Python package management under control: 1. Don't install anything globally. Don't pip install --user, definitely don't sudo pip install. 2. For each project you want to work on, create a venv. Yes, there are tools for this, but the base venv tool is totally fine. (venv should be included in your Python, but a few distributors like Debian put it in a sep…

Herein lies my problem. If I want to start a Node project I run `npm init` and then `npm install --save` to my heart's content. If I somehow manage to mess it up I just delete node_modules/ and install again. If I want to start a Python project I have to set up venv and remember to put relative paths in front of every command or else it'll run the system version. Sounds simple, but it's still something to always reme…

You have to use something like anaconda. It's basically the same as npm_modules (sorta).

Re: Python Is Eating the World

#409
I would argue that Pythons biggest issue is performance, which translates in large applications directly into costs. You will need more machines to scale and you will need more power per operation compared to other programming languages.

see here: https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

I think Python makes sense for prototyping and stuff like Jupyter Notebooks. But once mature and going into production I recommend porting stuff to something faster like Java or even Javascript nowadays.

Re: Python Is Eating the World

#410
post #34
post #4

If only its package management were as easy as its syntax... I wish pip worked the same way as npm: -g flag installs it globally, otherwise it creates a local "python_modules" folder I can delete at any time. And optionally I can save the dependency versioning info to some package.json... Instead, pip is a nightmarish experience where it fails half the time and I have no idea where anything is being installed to and…

Meanwhile, all the python developers who have started doing any Js work are saying “I wish npm worked as easy as pip/virtualenv”... It really isn’t that difficult, it’s just different. Different always seems wrong, at first.

I haven't seriously JavaScript'd in a couple of years but my problem with it then was different versions of node or npm. Nice thing about python virtual environments is that problem never exists (can make environments with whatever version you want).
Post reply on HN