Live data from Hacker News

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

new.pythonforengineers.com

51–60 of 269 posts

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

#52

> 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 defending the language when the people criticizing it seem to hold such a vastly different point of view. It's like trying to convince people that Natural Born Killers is a good movie or that Primus makes good music. There's an unbridgeable chasm between you and the people you're trying to convince.

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

#54
post #17

Earlier quoted context omitted.

Pip freeze will pin explicit as well as transitive dependencies

It's a hassle to do this correctly and upgrade the dependencies. Use poetry.

pip freeze > requirements.txt

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

#55

I tried porting a Python utility I wrote to Go specifically because I did not want people to have to install any 3rd party libraries (in this case just one). If anything I had a much deeper appreciation as to how much Python does for you and just lets you work. I would still like to port someday. For now I can containerize my app but that would still require people to install docker and learn how to use docker.

The easiest way to do this is to use shiv[0] if you don't mind asking people to have Python itself installed; if you want a truly "one file bundle" you should use PyInstaller[1] (which bundles a Python interpreter)

[0]: https://shiv.readthedocs.io/en/latest/

[1]: https://pyinstaller.org/en/stable/

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

#56

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

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…

Even using conda to manage reqs is an absolute nightmare. Did a subreq get updated? Did the author of the library pin that subreq? No? Have fun hunting down which library needs to be downgraded manually

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

#57
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

They clearly mean using pip on its own, presumably by `pip freeze > requirements.txt`

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

#58

i dragged my feet on go for a long time. i also thought that skipping go and moving to rust was the play. a few years later, i still write python often, but i don’t build systems with it. python i now use like bash, to glue things together and automate random things. it’s a fantastic language and i will never drop it. the verbosity of go is the biggest hurdle for a pythonista. the thought of giving up context manager…

Do Go programmers also not like capitalization? Just a tease, I noticed the readme and your comment don't have any Capitalized Letters. Well, the readme has a few but you know what I mean.

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

#59

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

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!

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

#60
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

Poetry requires pip in the way that `go mod` requires `go get`, i.e. Poetry allows one to operate at a higher level of abstraction, where it's harder to make mistakes and generally easier to manage your dependency tree.
Post reply on HN