2 ms·
Go is a very weird language :-(. It's very limited when you started to do complex thing. Example, let's say you are building websocket. You will have a hard ti
by kureikain 7y ago
Go is a very weird language :-(.
It's very limited when you started to do complex thing. Example, let's say you are building websocket. You will have a hard time to write type safe websocket handler to process the payload from client for all the events...
I started to do Rust/Crystal and both of them are better than Go(performance, type system).
Yet, whenever I build something for work, I come back to Go :-(. I told myself to use Rust or Crystal.
Then I realized that Go is a practical language. It compiled fast so it makes testing easier. The cross compiler just make it so easy to build binary run on everything thing. And the limitation of Go makes it very consistent on how you do thing. This makes working with Go become faster event by the fact that it slows you down on other parts.
So I think Go is a language that people easier to fall into because it has the speed of interpreter language like Ruby/Python(or even faster) during development and have a better performance/type safe story.
- apta 7y agoJava and C# provide the benefits you mentioned, while being more expressive languages and having better runtimes compared to golang.
- hu3 7y agoHardly. OP mentioned fast compilation and limited ways to code the same solution. C# and Java are slower to compile and offer way more options to do the same thing. Here's Uncle Bob take on testing with Go: https://m.youtube.com/watch?v=2dKZ-dWaCiU&t=36m40s https://m.youtube.com/watch?v=2dKZ-dWaCiU&t=36m40s
- apta 7y ago> C# and Java are slower to compile Not for any meaningful work in my experience. As a matter of fact, I found the change/compile/run loop in golang to be slower on projects I've been working on due to the fact that it doesn't support incremental compilation, so any change I make ends up recompiling the entire program and writing out a 100+MB binary anyway. Compared to a Scala project I worked on before (and Scala is notorious for slow compiles), after the first compilation, all modifications happen very quickly as only the respective classes are re-compiled. > Here's Uncle Bob take on testing with Go Again, this doesn't apply for any non-trivial/large project. On a project I'm working on, it literally takes 7-8 minutes to do a clean build + run all unit tests in golang.
- hu3 7y agoGo absolutely does incremental builds by default and has been like that since I can remember. Packages are only rebuilt when their source or their dependencies change. Same for tests which are cached by default so during typical development only a subset of tests are executed and compilation time can be a big part. Leave full tests for CI. An anecdote I found from 5 years ago: On my 1.7GHz processor it takes 10 seconds to build the whole standard library from scratch (300k lines of code). It's fast AF.