Live data from Hacker News

Breaking up with Python

cedwards.xyz

41–50 of 179 posts

Re: Breaking up with Python

#41
my friend made a write up before about the inadequecies of python: https://dustri.org/b/friends-dont-let-friends-write-producti...

Personally, I’ve been pretty happy with python, I think it works wonderfully as a glue language (like bash); I.E: you shouldn’t write a lot of it, you should use it for plumbing. Its fantastic for that.

Re: Breaking up with Python

#42

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…

In my experience PowerShell fits well as a toe-dipping language.

It allows to solve the menial tasks someone with no programmng experience usually needs to solve, can interact with HTTP/REST-like APIs, sometimes has the modules for a popular solutions, is object oriented, lax on the indentation *smirk*.

Re: Breaking up with Python

#43
> For years, Python has been my go-to language

> ...

> Python sucks. I mean the syntax itself.

So author notices that syntax sucks afters years of usage?

Re: Breaking up with Python

#44
post #11

I don't fully agree with these arguments, but they all have some validity. I really felt his point on the documentation - it's great that it's reference-complete if that's what you're looking for, but it's maddening if you are coming to something to find out what it does.

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.

Re: Breaking up with Python

#46
post #14

The article mentions using JavaScript in place of Python. I use JavaScript a lot for browser stuff but can JavaScript be used for the random command-line scripts that I implement in Python? (Genuine question, not rhetorical.)

Node.js can be used for command line scripts. Its chromes v8 JavaScript engine strapped to an API for interacting at the system level.

Re: Breaking up with Python

#47
post #4

I have just started getting into python as I'm experimenting with pytorch and after a lot of googling I'm still trying to figure out how to use conda properly. Could anyone point me to the best way to manage python environments and packages?

I always recommend the hyper modern guide to python. https://medium.com/@cjolowicz/hypermodern-python-d44485d9d76...

Thanks!

Re: Breaking up with Python

#48
post #4

I have just started getting into python as I'm experimenting with pytorch and after a lot of googling I'm still trying to figure out how to use conda properly. Could anyone point me to the best way to manage python environments and packages?

Use mamba instead of conda to install your packages, and always use the conda-forge channel. mamba is essentially a drop-in replacement. I have always found conda to be horribly slow for installing packages. For environments:

- `conda env create|list|remove` commands to manage them

- `conda activate ` to enter your environment

- `conda deactivate` to return to your base environment

If you want to use a conda environment in jupyter, you must install ipykernel and create a kernel definition for your environment:

    conda activate 
    mamba install -c conda-forge ipykernel
    ipython kernel install --user --name 
In practice I have found anacondas environment management and usage to be pretty seamless.

Re: Breaking up with Python

#49
It's rich that the author unfavorably compares python's docs to go's. Go's documentation is barely more than API auto-doc level documentation: and many if not most of the open source projects using it have followed suit. It's some of the worst documentation out there, in my opinion.

Re: Breaking up with Python

#50
There is no reason to start a new project in python IMO. Existing ones should be deprecated.

the packaging ecosystem alone is enough to make anyone mad. I maintained a production system in python for a few years a while back and code refactoring was extremely painful.

I hope I'll never touch python again.

Post reply on HN