3 ms·
I ported a fairly complex (thousands of lines of code, in use in production) program from Python to Go. The Python version is around 1/3-1/2 the size of the Go
by dantillberg 7y ago
I ported a fairly complex (thousands of lines of code, in use in production) program from Python to Go.
The Python version is around 1/3-1/2 the size of the Go version, but the clarity with which bugs are visible in the Go version is astonishing.
There's a lot of code in Python version that "looks right" and even "does kind of the right thing a lot of the time." But the Go version lays bare corner and edge cases that were not obvious in the concise Python version.
I agree that Go usage does suffer sometimes from lack of generics. I've sometimes used code generation in its place, and it works, but it's a poor solution. At the same time, the lack of generics has helped me avoid over-abstracting in other places, which is a common bane of mine whenever I work in more "expressive" languages.