pull down to refresh

I have become a Go maxi.
After a long time working with Python and NodeJS software and after the initial weirdness (wtf are channels and goroutines and why should I care), it's feels really nice to work in a statically typed language (without generics however ...) again where concurrency support is built-in with goroutines and channels. It feels soooo much better to have a compiler do type checking for you (in a guaranteed way) even if that means you have to define your types first, so you are slower first. But I would trade runtime errors with compile-time errors any time.
Also, the build process spits out a single binary which can be run anywhere where golang is installed (afaik) and the ecosystem is not a complete mess like Python (looking at you, Python package managers) and NodeJS (npm vs. yarn, CJS vs ESM, Javascript vs TypeScript). I also like how imports work in Go. In Python, you run into this circular import issue pretty fast if you don't try to stay ahead of it.
I also tried to learn Rust but the syntax felt rough. When I tried out Golang, I didn't look back.
@theindranetworkprotocol also made me try out Go. If I remember correctly, he also mentioned here and there how awesome Go is.
I like Go because Go lets me write code and then build the structure as I go. You gotta watch out for race conditions with maps and slices, make sure you isolate things using interfaces to avoid tight coupling, the pattern of passing closures is a good way to keep the code concise and single-responsibility.
The best thing about Go is you can just dive into it. The worst thing about go is that you can just dive into it. The drowning feeling you can get sometimes when you tinker with too many pieces at once inside a concurrent system... thank Linus for Git so I don't have to restart the whole thing from scratch!
reply
What IDE do you use? Mine just expired.
reply
I know you didn't ask me, but I'm inserting my answer anyway lol
I don't use an IDE, but on rare occasion, I'll use cherrytree as a note taking app to organize thoughts
It seems to have some IDE like aspects in there if you choose to use it for programming as well.
reply
I use vscode because I work in multiple languages and I like how it's more a text editor than a full-blown IDE.
reply
Wait, Go seems to support Generics, lol: https://go.dev/blog/intro-generics
I think I confused Generics with function overloading. This is what Golang does not support. But I was able to deal with it. Was just unexpected but not that big of a deal in the end.
reply
After coding in C/C++ for 5+ years, I loved golang (I was a go maxi for ~3 years).
But if you are trying to build software that solves problems not requiring statically typed and compiled code, you can produce solutions faster in more expressive languages eg js.
Coming from a golang background is one reason why I'm so excited about the Deno runtime ... It lets me use the most popular expressive programming language (js) with a golang-like package management system and can produce standalone binaries like golang. It's not ready for primetime yet, but it'll get there.
tbh if I could have my way, I'd prefer to program in a Lisp dialect ... it doesn't get more expressive than ad hoc DSLs.
reply
Go has interfaces. There's no need to complicate a language with more than one effective way to do things. You can mimic much of the behaviour of variants and generics with interfaces. And the interfaces available in Go since 1.18 are a pretty slim set and don't include any structured types. You can do signed/unsigned/float and you can do arrays (predefined size) but that's it, at least if I have grasped it correctly.
Easy way to remember if Go has a feature: is there a simpler way to do it? Ok, no. No map/reduce/filter or complex iterators, no generics, no objects, the slice and map are naked and barely cloaked pointer types that make for some racy fun with goroutines.
reply