Live data from Hacker News

Learning Go as a Python Developer: The Good and the Bad

new.pythonforengineers.com

61–70 of 269 posts

Re: Learning Go as a Python Developer: The Good and the Bad

#61
> I hate how it forces to you create a module everytime.

This affected me recently, so I have sympathy for the author. Trying to upgrade an older project I had to the module system meant trying to find out how to import modules which don't have reachable URLs and were only on the GOPATH. At I hate how it forces to you create a module everytime. some point programming in Go stopped being for fun.

Re: Learning Go as a Python Developer: The Good and the Bad

#63
post #50

Earlier quoted context omitted.

I recommend using poetry and just moving on with your life, it’s far easier than trying to use pip (which is totally doable, but not clean).

But poetry requires pip… you can't use it without using pip

Kind of. It's intended to be a system package/tool. In that regard you can use, wait for it, yet another python tool - pipx. So instead of installing poetry to a venv or whatever using pip, you can use `pipx run poetry`. Now you have to install pipx...

Re: Learning Go as a Python Developer: The Good and the Bad

#64
post #18

>sharing your code is even pain with colleagues even if they are using the same operating system, mainly because the Python requirement file doesn't pin dependencies, wat? Pretty sure you can use == in requirements.txt Also, its very possible, and quite easy to just include the code for the library in your package, which effectively "locks in" the version. We did this all the time when building AWS lambda deployments…

Sure can pin versions, it’s easy too, if you just use «pip freeze».

Now you lost track of which are your top level dependencies and which are dependencies of dependencies.

Re: Learning Go as a Python Developer: The Good and the Bad

#65
I only use python casually, but it seems to me that python library authors are always refactoring and breaking interfaces.

Recently, there was a bug in a second order dependency, and the version that fixed this bug was after a version that moved a function into a submodule.

So I had to make a local patch to my dependency that changed all of the imports.

Was the new interface more consistent? Yes, but could they have left a shim for backwards compatibility, or just lived with the old slightly less consistent interface? Seems to me like they could.

Re: Learning Go as a Python Developer: The Good and the Bad

#66

> I had heard of Go for many years, but never stuck with it; it gets constant negative press on Hacker News/Reddit I think on Hacker News it's really fashionable to criticize Go, and this has led to a culture where Go gets significantly more negativity than it deserves. As technologists, one of our most important jobs is to see through such fashions and judge languages/tools/technologies based on their actual merit.…

As an engineer who uses Go and appreciates it as a replacement for most purposes where you might use C or C++, the complaints just seem bizarre. You've got people who argue against explicit error checking and people who don't understand the important role of nil pointers and people who don't see the massive net win of garbage collection in concurrent programs, and so on. Endlessly. It feels like a waste of time defen…

[deleted]

Re: Learning Go as a Python Developer: The Good and the Bad

#67

>sharing your code is even pain with colleagues even if they are using the same operating system, mainly because the Python requirement file doesn't pin dependencies, wat? Pretty sure you can use == in requirements.txt Also, its very possible, and quite easy to just include the code for the library in your package, which effectively "locks in" the version. We did this all the time when building AWS lambda deployments…

You can go even further now with PEP508 https://peps.python.org/pep-0508/

Re: Learning Go as a Python Developer: The Good and the Bad

#68

Earlier quoted context omitted.

This comment section itself clearly shows how crazy dependency and environment management is in Python. In this thread alone, we've received instructions to... - poetry - "Just pin the dependencies and use Docker" - pip freeze - Vendoring in dependency code - pipreqs - virtualenv This is simply a mess and it's handled much better in other languages. I manage a small agency team and there are some weeks where I feel l…

Don't forget Anaconda because you're on windows and have no idea how to compile random packages that are really C++ code with Python bindings!

    Solving environment |
    Solving environment /
    Solving environment -
    Solving environment \
    Solving environment |
    ...
One day it takes 10 seconds, next month it takes 10 minutes, and the month after that it takes 30 minutes and then fails entirely.

Re: Learning Go as a Python Developer: The Good and the Bad

#69

Earlier quoted context omitted.

Directories with an __init__.py are not modules, they are packages. Modules are .py files

The __init__.py is also itself a module, which you import by importing the package. That's confusing, and not easily avoided!

Make it an empty file?

Re: Learning Go as a Python Developer: The Good and the Bad

#70

> I had heard of Go for many years, but never stuck with it; it gets constant negative press on Hacker News/Reddit I think on Hacker News it's really fashionable to criticize Go, and this has led to a culture where Go gets significantly more negativity than it deserves. As technologists, one of our most important jobs is to see through such fashions and judge languages/tools/technologies based on their actual merit.…

As an engineer who uses Go and appreciates it as a replacement for most purposes where you might use C or C++, the complaints just seem bizarre. You've got people who argue against explicit error checking and people who don't understand the important role of nil pointers and people who don't see the massive net win of garbage collection in concurrent programs, and so on. Endlessly. It feels like a waste of time defen…

> people who.. don't understand the important role of nil pointers

... I guess you're right; I really do not understand

Post reply on HN