How is your productivity with Go compared with other more higher level languages?
Cognitive load of GO vs other languages
Why Go is better than any other backend language?
Go Performs 10x Faster Than Python
Videos
I came to Go from Ruby but I've been writing mainly Go for quite some time now and I forgot how it was to work on a Ruby project. For those doing this daily, with PHP, Python, Ruby, JS, ..., do you feel that there is a huge productivity gap between those languages and Go when dealing with web applications? (server side rendering)
So I wrote an app a few weeks ago that had a frontend written in Alpine JS and PHP on the BE. I used PHP because I wanted something easy to deploy (typically use Ruby for web dev). I decided to port it to GO for fun because I did a bit of go before.
It took 3x as many lines as PHP! 3x as many. Crazy. That's partly because you can't have 1 line if statements with my linter and because of all the error handling.
BUT, what I noticed is that even though it's much more verbose the cognitive load with GO is SO MUCH LOWER.
I love to code and have been doing it for 25+years but I realize that sometimes when I have hard features to code I sort treat it like a mission I have to go on. I know it's going to be stressful and unpleasant.
With GO however it all seems pretty easy. For one the fact that it's staticly typed is a lifesaver. I'm used to that with C++ and Java though, but the way Fiber handles taking your POST JSON and sticking it into a struct is great. You don't have to wonder "wait, is this actually a string when I thought it was a number?" That really mitigates a lot of the stress of building webapps. That communication layer between FE and BE can be a pain.
I feel like my mental CPU clock just stays at 15% instead of averaging 50% and spiking up to 100 frequently (sort of like GO vs Node on a server). I just can't get past that. Even though the language itself is nothing special. It doesn't even have ternaries, but I can always look at the code and it's basically as simple as it gets.
Idk, writing go I just feel a big weight has been lifted off of my shoulders, I don't mind the stress of programming, I enjoy the fight but now I'm like "huh, I'm really productive and I'm not stressed at all..."
As I mentioned earlier I used PHP because it's easy to deploy. Well... GO is not QUITE as easy to deploy as PHP, you can't just stuff your files on a shared host BUT I've been deploying to a DO node by just FTPing in and dropping my self contained executable. That's really, really easy. Also, I use NGINX so I just make a nginx entry for it and there you go. Plus it takes so little ram that you can deploy like 10 go apps to one $5 vps.
Plus when you need to look at the code of a package you use it's pretty easy to understand what's going on in most cases.
I'm honestly surprised GO isn't more popular. Like it's not the cool kid. People are loving typescript (which is a nightmare to me personally) and want to use it everywhere but like to me it's not worth it.
And the best part, is that it gets amazing performance out of the box. I tried Rust which is an enigma wrapped in a mystery inside a riddle (thanks WC). It's so painful to get working with it, and GO isn't as good as Rust in terms of performance but it's close enough and it's about 20x easier as a language.
Anyway, just wanted to share that. I really like it.
Edit: Also recompiling is a pain but the fact that so many errors are caught before or during compile makes up for it. With dynamic languages it's like "Okay now it's reloaded... What did I break, lets see"