DEV Community

Discussion on: After learning Go, what made you stay with it rather than use a different language?

Collapse
schollz profile image
Zack • Edited on

I was into Python a long time until I heard about Go a few years ago.

I code in Windows. Go was an immediately useful to me as a Windows user because I didn't have to worry about weird ecosystem things (Python requiring Admin to install, Python requiring prepackaged science libraries). Also Go was awesome because packages were so much easier to understand and create (just upload to Github with a header "package X"). And with Go I could write programs that my non-dev friends could run (Python required me telling them to install Python, pip, x, y, z, etc., whereas Go I just sent them a binary).

Despite the negative press, I also love GOPATH. GOPATH lets me essentially work "in the cloud." Since almost everything I do is in the GOPATH (this has never been a problem for any of my many projects), I can rest assured that I can easily delete the entire directory and bring it back up with a simple "go get".

In Python there are too many ways to do tooling - too many testing paradigms, too many packaging paradigms, too many formatters (though its starting to come to a head). I love that in Go, all of this has been done, and its done well because I never have to worry about these things and actually I tend to enjoy writing tests, making packages, formatting code.

This is more of a Python vs Go, but that's my experience. I will say I still love Python, and the one thing that keeps me from writing Go only is that its so much easier to do JSON in Python (Go requires building structs beforehand and it becomes inflexible unless you want to give into reflection).

Collapse
qm3ster profile image
Mihail Malo

How is that better than rust's cargo or node's pnpm?

Collapse
schollz profile image
Zack • Edited on

Personally, I do like GOPATH a lot better than node_modules because of the global dependencies. In NPM you have a dependency repo for every project which is not so bad, except the culture of Node is to have a module with 3 lines of code and 300 lines of tests so every single project has hundreds of MB's of node_modules... I also like GOPATH a tiny tiny bit better than .cargo because I only have to keep track of one directory (GOPATH) instead of two directories (.cargo and whatever directory I'm currently working in).

Collapse
autoferrit profile image
Shawn McElroy Author

I actually like the GOPATH setup too. i already had something similar so it was easy to go with