4 ms·
> Go and Python are also pretty related for command line apps too. You could totally use either one to build a CLI tool. Distribution of Go CLI apps is much ea
by malvosenior 7y ago
> Go and Python are also pretty related for command line apps too. You could totally use either one to build a CLI tool.
Distribution of Go CLI apps is much easier as you don't need to have your end users install the 3rd party libraries themselves.
- nickjj 7y agoYeah totally, for using CLI tools I much prefer using a Go binary too because it doesn't involve installing anything. But in practice as a web developer who occasionally writes CLI scripts, I personally didn't think it was worth going all-in with Go for that. Especially not when for smaller scripts you can have a Python or Bash script in 1 file[0] and it will run on all major platforms without installing 3rd party libraries too. Most major distros of Linux, MacOS and WSL on Windows have both Python and Bash available. For my use cases that's good enough. [0]: For example just the other day I released a ~200 line self contained Python script to solve a problem I had which was figuring out what changed between 2 web framework versions: https://github.com/nickjj/verdiff https://github.com/nickjj/verdiff
- falcolas 7y agoGiven the broad capabilities of the Python first party libraries, you can do a lot of work without 3rd party libraries. It’s not in as much fashion as it was 10+ years ago, but it’s still quite doable.
- cutler 7y agoAs far as I'm aware Go doesn't return the exit status of a process the way Ruby and Python do. Surely this is a big disadvantage for CLI scripts?
- malvosenior 7y agoSure it does: https://gobyexample.com/exit https://gobyexample.com/exit If you mean Go can't read the exit status of a command it runs, that's incorrect as well: https://golang.org/pkg/os/exec/#pkg-overview https://golang.org/pkg/os/exec/#pkg-overview
- yellowapple 7y agoThis is true for Python, too, albeit quite a bit harder due to the relative lack of first-party tooling for generating standalone executables.