comment-anything / proposal

Comment Anything Browser Extension
MIT License
0 stars 0 forks source link

Adopt Go as the Language for the Back End #10

Open klm127 opened 1 year ago

klm127 commented 1 year ago

Go came out on top in our straw poll yesterday so it deserves serious consideration and analysis as a candidate for adoption for our main server. I've given it is own issue so we can address concerns with Go specifically.

I think other candidates for back ends deserve their own posts describing their merits in more detail so that I can be convinced.

I will attempt to convince you that we should adopt Go because we all need to be on board with the technology we choose for the project.

Better for our Use-Case

Our application should be able to handle lots of requests while waiting for the database performantly and Go is the most performant for concurrent operations, which is what a back end server does. Anything can handle authorization and serving of JSON from database queries; we should allow this application to handle multiple requests for that data without having to create heavy, limited Operating System level threads or relying on an 3rd party library in another language that will be more verbose and still less performant than Go.

Go is designed for our exact use case; if it's good for anything, it's good for APIs like we want to make. It's also easy to write and understand and most of what we want can be done with just the built in libraries.

Become a Better Programmer

We will be learning new technologies doing this project no matter what and Go is a good thing to learn.

Learning Go will make you more powerful a programmer.

There are situations where something else would be better

One limitation of Go is if you want a certain inheritance-focused paradigm. And for very large applications, the OOP features of Java or Asp.net could be necessary to manage the code base. But our project hardly calls for that. Those languages also have many libraries and large communities.

However, Go's community is also mature and its libraries are excellent for our purposes. Go does still keep value at an enterprise level - distributed systems like Kubernetes find use for go. It's also used at Google (of course), Uber, Twitch, Dailymotion, Dropbox, Soundcloud.

Even though it's only maybe 8th or 9th right now, it has a high adoption velocity that might magnify when Go 2.0 comes out with more generics and try/catch and its suitability for distributed use cases make it a valuable skillset across the board.

Why do companies switch to Go? Why do they spent all kinds of $ in time for their team to transition to a new language? Because it has powerful features that make it worth it and they save a fortune in performance.

Companies will keep switching to Go from Java or C# and blogging about it; far fewer will switch back.

On an individual basis I suspect that when comparing two equal coders with equal knowledge of Go and Java, the coder in Go will be able to make more finished applications in the period.

Tyler Katz on Quora, a software developer since 2005, calls Go a Higher Leverage language for that reason.

Isaac Krementstov explains that Java has to create a huge thread for each request.

I've shared some of the benchmark comparisons I've found already.

Having tried it last Saturday, I liked its tool chain, syntax, and compilation speed.

Here's a project we can look at in Go that does a lot of what we want to do. (A forum)

Hopefully these arguments can convince you that Go is the right choice for our project.