by spacey on 9/26/22, 7:25 PM with 284 comments
by nu11ptr on 9/26/22, 9:57 PM
by geenat on 9/27/22, 2:16 AM
* No optional/named parameters. Writing a whole function per parameter for function chaining is excessive. This would not be difficult to add to the compiler (i've done it and have seriously considered using the fork) but it seems like the team is just stubborn about adding stuff like this.
* No default struct values. 0 isn't good enough in real world scenarios.. have fun writing BlahInit(...) for everything.
* Would be nice to get the question mark syntax for error handling. Error handling shorthand for if err != nil would also be very welcome.
by pbohun on 9/27/22, 12:53 AM
by tbrock on 9/26/22, 10:34 PM
by tomalaci on 9/26/22, 9:05 PM
Besides its GC implementation that works very well most of the time, it also has simple but strong debugging tools to investigate how well you are handling memory allocation and CPU usage. Enforcing consistent coding style also makes it very easy to read other people's code and quickly contribute.
My suggestion to others is to avoid prematurely optimizing memory usage (e.g. trying to do zero-copy implementations) and always investigate performance via these profiling tools Go offers (e.g. pprof). Very often Golang's compiler or runtime will automatically optimize code that may not seem to allocate optimally.
There are still downsides but some of them are actively worked on:
1. Generics are still lack-luster (... but good enough to start replacing a lot of boilerplate code and will improve later on)
2. Error handling is still tedious (fortunately it seems to be their next big focus), it should take less code-space and have an option of stack-trace
3. Stdlib logging is too simple, lacks levels and structured-logging-style (currently actively discussed: https://github.com/golang/go/discussions/54763)
4. Low-level UDP networking is weak (soon to be fixed as they accepted this proposal: https://github.com/golang/go/issues/45886 ), this will become more important as we transition to QUIC protocol
5. CGo (C interop / C FFI) is pretty bad performance-wise compared to other languages, it's OK if it is an I/O operation but anything C interop that requires low latency won't be running great
6. Similar to other languages, nowadays there are growing external dependency trees (e.g. I always wanted to use testcontainers-go to make integration tests easier but man, have you seen the dependency tree you will pull in with that pacakge?), solution in my eyes is flattening and standardizing most commonly used packages but Go in particular is very opinionated regarding what is included in stdlib
The above downsides mostly come from the background of creating distributed data pipelines and certain data collectors/parsers. For building API servers, I keep hearing it is a godsend in its simplicity, so your mileage may vary depending on the business domain you work in.
I would be interested to hear other people's experience with Go, however!
by synergy20 on 9/26/22, 10:36 PM
it makes great sense for network with concurrency, not so with real time or low resource devices to me.
by philosopher1234 on 9/26/22, 7:57 PM
by nhoughto on 9/26/22, 9:27 PM
by throwamon on 9/26/22, 8:16 PM
by nwmcsween on 9/26/22, 9:05 PM
by BenFrantzDale on 9/26/22, 11:17 PM