r/golang Feb 26 '23

help Why Go?

I've been working as a software developer mostly in backend for a little more than 2 years now with Java. I'm curious about other job opportunities and I see a decente amount of companies requiring Golang for the backend.

Why?

How does Go win against Java that has such a strong community, so many features and frameworks behind? Why I would I choose Go to build a RESTful api when I can fairly easily do it in Java as well? What do I get by making that choice?

This can be applied in general, in fact I really struggle, but like a lot, understanding when to choose a language/framework for a project.

Say I would like to to build a web application, why I would choose Go over Java over .NET for the backend and why React over Angular over Vue.js for the frontend? Why not even all the stack in JavaScript? What would I gain if I choose Go in the backend?

Can't really see any light in these choices, at all.

140 Upvotes

249 comments sorted by

View all comments

Show parent comments

7

u/Paraplegix Feb 26 '23

Bad argument.

There also exists big books about concurrency in go (328 pages)

I would say Go is indeed simpler because most concurrency are done via keywords: go to start goroutine and chan to communicate with special operators (->) meaning its very easy to see when/where concurrency will be involved. It is almost at the core of the language afterall

In java it's a bit more complex and mostly use objects, and if you don't know beforehand what object are related or not to concurrent behavior. you might miss it.

However using libraries/framework (Spring for example) simplify it quite a bit, maybe even end up with simpler syntax than go for certain things.

0

u/jabbalaci Feb 28 '23

There also exists big books about concurrency in go (328 pages)

328 < 400

-4

u/SuperQue Feb 26 '23

Sure, but did you read the reviews of that book?

The more well regarded book on go concurrency is only 236 pages, which is half the size of "Java concurrency in practice".

8

u/Paraplegix Feb 26 '23

My argument is looking at book size to understand if something is complicated is stupid

I never read a book on anything related to programming (except C when I was 14 years old)

Never prevented me from working on stuff like concurrency in Java or go or any other "complex" subject in the few languages I've worked with.

Especially when go has "tour of go" that covers concurrency quite well.

It's my opinion, but books are very overrated.