Thoughts on Golang
We have in process to switch some parts of our codebase to Golang from Python.
I am a long-time Python developer mostly writing backend code in the last 8 years.
I have also worked with PHP, Java in the past but my primary language is Python. And I love it! However, in the last couple of months, I have been learning and coding Golang. And, have to say, I am impressed!
Why we did switch to Golang?
We're sending a lot of HTTP requests to 3rd party providers. I am talking about huge numbers like 100k requests per minute. Whenever a provider having a problem, starts responding slowly, then it will hit our network usage and causes a queue.
This is because we're using standard python threads and don't have an async model of sending HTTP requests. While it's possible to send async requests in python (asyncio, tornadoweb) they're not the main concept of the language. Python designed to work in sync from the start.
Golang is a perfect choice and works very well for such cases.
Thoughts after python development
The good
Concurrency. The best part of Golang is that they have a concept of go-routines. Which makes it very easy to code concurrent applications. All you need here are ready in the standard library.
Statically typed, compiled language. However, compile times are fast. You don't wait for the compiler to try things.
Simplicity and readability. Go forces you to write simple applications. You can read any source code written in Golang, understand it easily. Also the "go fmt" makes sure, all source code is formatted in a s
standard way.Performance. Go is faster than Python in almost all cases. Comparing them sound like a bad idea since one is compiled while the other is interpreted. However, if you switch from Python, you will enjoy your lightning fast applications.
Deployment. Go runs in a single, static binary. That makes it deployments easier. You don't mess with virtual environments.
Testable code. Golang's strict structure and practices forces you write testable code. It has a good support for unit-testing and writing them is easy.
The bad
Lack of generics. You need to paste duplicate code for the same functionality. This really hurts me while coding re-usable functions and helpers.
Packages/Dependency management. Even though it's simple and efficient, you cannot handle versions of vendor packages. Which makes it harder to track them.
Error handling. I am not a fan of Golang's error handling practices. I miss exceptions here. However, they have a good blog post explaining this model.
Conclusion
I have really liked the strict style of Golang. It expands the initial development time but in the long run, you will have much faster applications with less runtime errors.

Interesting ! I've been wanting to look into it myself for quite some time but I've been busy.
You should have a look! :)
I also do most of my work in Python, and I'm interested in Go too. The thing that has stopped me trying it so far is that I'd still generally need Python for the Numpy/Pandas libraries, so would then need both in my stacks. I'm presuming there still aren't many libraries for that type of work for Go? It's not so much of a multi-purpose language I suppose.
Not sure Golang has similar libraries like Pandas and Numpy. I still prefer Python for the things I needed fast. It cuts the development time drastically.
However, If I need to code a concurrent application, then my choice will be Golang for sure.
@emrebeyler payed 1.0 SBD to @minnowbooster to buy a stealth upvote.

transaction-id e036b888113f2fc3f9403cac64ce218fea3f5b6a
@stealthgoat
img credz: pixabay.com
Nice, you got a 62.0% @peaceandlove christmas upgoat, thanks to @omersurer
Want a christmas boost? Minnowbooster's got your back!
The @OriginalWorks bot has determined this post by @emrebeyler to be original material and upvoted it!
To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!
If I could turn back !BEER
_
View or trade
BEER.Hey @emrebeyler, here is a little bit of
BEERfrom @isnochys for you. Enjoy it!Get your post resteemed over 90000+ followers and get upto $19+ value Upvote. Your post will skyrocket and give you maximum exposer.
See our all pakages at: