3 ms·
Python is good because it has batteries included. Other languages have taken a more idealistic approach of not including batteries. Python understands that pro
by zarzavat 2y ago
Python is good because it has batteries included. Other languages have taken a more idealistic approach of not including batteries.
Python understands that programmers just want to get shit done without have to search what is the current hotness in XML parsing or whatever.
Python understands that I don’t want to set up a package management environment for every tiny script I write. I can install a package once, globally, and then I can use it forever.
- arcanemachiner 2y ago> I can install a package once, globally, and then I can use it forever. I use pipx whenever I need to install Python packages globally. Other than that, it's virtualenvs all the way. I ran into some dependency hell a while back after globally installing Python packages with pip. Never again.
- pzo 2y agonot only about batteries included but even more about ecosystem of 3rd party libraries such as numpy, scipy, pytorch, onnx and other batteries build on top of that: opencv, open3d, mediapipe, pyqt, etc. and frameworks: django, fastAPI, fastHTML. At this point they are like C++ - not the most beautiful language and there are many better but ecosystem is too big to ignore.
- fire_lake 2y agoFunnily the recent Clojure release shows how to do this far better. Python packages are global (or global in a virtual env) and you need to install them before running your script. This is horrible! You should be able to lock down dependencies in the script itself, and they shouldn’t modify the global environment at all.
- zarzavat 2y agoHow does that work if you use a REPL? If I type $ python >>> import numpy as np >>> import pandas as pd Everything’s just there for me. I want my Python packages installed globally, Python is like a Swiss Army knife always ready for me to use. Yes you can do dependency management in Python, but I very rarely use it because Python is not so good as a language for software development. If I want to write serious code then I use a serious language with a serious type system. If I want to parse or download or analyze or automate or generate something, I use Python.
- fire_lake 2y agoConsider import cowsay This only works if you have installed cowsay. Send your script to a colleague and they also need to install cowsay. Often Python packages are extremely difficult to install - incorrect version constraints, weird native packages, etc. And it’s not just colleagues on other machines; it’s also your own machine some time in the future. Python scripts may be convenient at the point of creation, but at any other time or place they can be a nightmare.