5 ms·
Things I love about it: - gofmt. The fact that it comes with an opinionated formatter means I don't waste time with bikeshedding. - Simplicity. I love how Go
by tail_exchange 3y ago
Things I love about it:
- gofmt. The fact that it comes with an opinionated formatter means I don't waste time with bikeshedding.
- Simplicity. I love how Go just gets out of my way and lets me do my work. I also don't need to worry about crazy abstractions and deep levels of inheritance.
- I usually don't need to worry about performance bottlenecks. Go is pretty fast.
- Typed. Over time I ended up hating languages like Python and JavaScript because of the lack of typing. Typed languages let me catch a large amount of errors at compile-time, and it also serves as documentation.
- Go-routines are a very elegant way to deal with concurrency.
- The standard library has a great selection of tools like JSON parsing that are usually not native in other languages.
- Dependency management is pretty good. Not the best, but definitely better than languages like C++.
- Single binaries. You can compile a Go application into a single binary and have it as the entry point of a container.
The result are very small containers that start up very quickly.
Thing I don't like about it:
- Error handling got better over time, but it's still annoying to find out if an error is of a specific type in legacy code.
- It would be nice to have more built-ins for lists, such as .includes(), .filter(), .map(), etc.
- Nil pointers. It would be great if there was a way to ensure points will never be nil.
I was really skeptical about it at first, but it quickly became my favourite language.
- Tozen 3y agoSome good points are presented. Interestingly, Vlang (https://vlang.io/ https://vlang.io/) has the .filter(), .map(), etc... and addresses Nil/Null (relegating it to unsafe). Error handling is done differently (with many liking that style), but this point tends towards a programmer's preferences.
- cookiengineer 3y agoI would want to add to the above list: - I love golang's build toolchain. Cross-compilation is just an environment variable. - I love its go:embed functionality, as it removes the necessity of crappy squashfs based solutions, and allows embedding all assets e.g. a webserver/website needs. What I both like and dislike: - Marshalling. It can be a joy to use marshalling when you are in control of the data structures, but it also can be PITA when you have to parse external JSON data structures that do not conform to the same types. - Something like parsing an arbitrary package.json, where fields can be e.g. a string, an array of objects or a single object is real pain to do in golang because it requires to use the reflections API. - Having to use signal channels to synchronize threads/routines. Sometimes it's just easier to use a for true loop than using a signal channel, because a signal channel isn't compatible with the program architecture. It would be nice if there was a cleaner way to spawn channels via goroutines (e.g. channel = append(channel, go func...?)
- drakonka 3y agoAll of this. Another thing I love is its test tooling and test conventions. Go makes it very intuitive, efficient, and (for me) fun to write tests early and often. _Not_ testing feels like a waste of really great tooling shipped right with the language.
- Alifatisk 3y agoThank you for this comprehensive list, this made me more excited about the language. These were the highlights for me: - Simplicity - Typed - Go-routines - Single binaries (Cross-compilation is just an environment variable) > - Nil pointers. It would be great if there was a way to ensure points will never be nil. Like Dart sound null safety?
- tail_exchange 3y agoI never used Dart, but from the examples I saw online, seems to check out. Go is more similar to languages like C, where you use a * to declare a type as a pointer. So an int is just a value in the stack and cannot be null, but an *int is a pointer to somewhere in memory and can be null. It would be lovely to have a third option in this list, something like *int for non-nullable pointers and *int? for nullable pointers.
- DanielHB 3y ago> - Typed. Over time I ended up hating languages like Python and JavaScript because of the lack of typing. Typed languages let me catch a large amount of errors at compile-time, and it also serves as documentation. Funny, I actually think golang typing to be extremely weak and hard to use, especially with all the pointers vs non-pointer values. Typescript is by far the best type system I ever used, but even compared to Java/C#/C++ the golang types are archaic and basic, more akin to ANSI C in power Yes the types are better than dynamic languages, but compared to modern type systems it is not very good
- henhouse 3y agoThere’s a great “lo” package which implements these JS-like array and map functions using generics in Go. Coming back from a JS/TS job I’ve been really happy to find this.