📜 ⬆️ ⬇️

Who needs Go and why?

image
Hey Ya! In short, lately there have been many srachs around Go on Habré: good, bad, needed, unnecessary, much compared with python, much compared with rastom , divan0 even thought of translating the vyser Go vs Haskell well and in that way. I got the feeling that because of Hip and aggressive marketing of the language by some Ivani Danilyuki, very few people understood to whom and why in general Go can come in handy, why did they do it and whether it is worth teaching them at all. I also participated in these srachs for a long time, taking the side of the “fans” of the language and the side of the opposition in shifts, but in the end I drew, what is the focus. Today, a little down at the sofa in the post and decided to write this note here.

Come on, boys, go through the post.

Who needs Go?


I just realized today that almost no one really understands why Go is needed at all. In short, Go is needed in order to design robust software. I do not know how to properly translate this word into Russian, but it is most likely something like “reliable”. So, Go was done, because Google needed a tool for writing reliable code. In fact, not as much as Google, as Rob Pike, who for the last two decades, as minumum, is obsessed with making a donut with channels and green streams. It so happened that Rob Pike got into a normal compass with other touches from Bell Labs, the coolest Russ Cox, Fitzpatrick, etc. It was not hard for these guys to convince Google that they needed a new language and, in general, they had knocked the women out of it.

So, it was a small lyrical digression, let's go back to the topic. Yes, why did Google need a new language? Well, everything is clear here, let's listen to the words of Rob Pike himself:
The trick is that our programmers are Googlers, not scientists. These are usually young, just released boys who may have learned Java, maybe even C / C ++ and maybe Python. They are not able to understand the probed language, but we still want them to make good software. Thus, we give them an easily understood language to which they will quickly become accustomed.

And now let's try to understand what he meant. To put it bluntly, he said that not the smartest guys work in Google (“not able to understand a cool language”), so they came up with a language that is simply impossible not to understand. This is actually very cool for management. Judge: you can hire 100 mediocre programmers, give them into the hands of Go, and this army of monkeys will generate you a lot of “quite good” and very much supported code! Go is a fantastic management tool, it’s better not to think up: we instantly drive all programmers into go-fmt (nobody can push through their own formatting style), we take away any abstractions from them that are more complicated than the interface and we get such a code in which developer is just another brick in the wall. In my opinion, very cool! Well, programmers most likely will not really like this situation - very few people like to be a cog in the system.
')
So, Go is needed by corporations . If you have a lot of people working for your company, big projects and all that, then Go is the perfect option! But in order to understand whether you really need Go, you need to figure out WHY it should be used. Let's find out.

Why do you need Go?


On the technical side, Go’s niche is quite modest: network, utilities, backends. If you have complex networks or a lot of nodes that need to be orchestrated somehow, then Go is a good choice (judging by the experience of CloudFlare). If you want to make some kind of cool console utility, like a docker or a consul, then Go, too, will be fine (judging by the experience of these). I now also do an interesting utility and write it on Go, because it fits. Well, in the end. If you need a fast and, in principle, effective backend, you can also choose Go. I have no idea how people write business logic on Go, but somehow they write the same! In short, everything is quite difficult. On the one hand, it is quite painful to do CRUD in Go, on the other hand there are 350 different routers and frameworks that make it easier to work.

As for the other niches, I can assure you with certainty: complete profanity. If Go is seriously used somewhere, then in console utilities, on networks and backends. More yuskeys no. And let's not invent them. Go was originally a language that was made in Google so that students could come and write code for Google’s sophisticated network infrastructure. Here you can form a kind of rule of thumb: " If you do not write software for the network, a console utility or a highload backend, then you most likely do not need Go ." Nevertheless, the software continues to be full of people on Go for the sake of strictly speaking, Go itself.

Is it worth learning to go?


This is a question that can be answered with a short and unequivocal answer. Go is worth learning anyway . Firstly, because it’s like two fingers to piss - it’s easier to invent a language. Go has very few grammars and abstractions; you can master it at the beginner level over the weekend. Of course, there are a lot of holes in the language and “loshpetov traps”, which I wrote about in my last article , but they quickly rezolvitsya.

Secondly, because Go anyway will penetrate very deeply into our lives. Over the past year, many projects on Go have been written on the githaba, more and more corporations are sitting on it, etc. To have such a popular tool in stock is always good, if not cool. Suddenly, you will be expelled from work and quite by chance a cool offer will fall to the position of a programmer. And then figase and you come up, because the weekend he jerked off a year ago.

For those who directly can not hold back and ALREADY vyprigivayut of cowards, I immediately throw a few links to the materials:


Dare, Go will definitely not harm you. Well, maybe you'll miss gofmt later, but it's not really scary.

Conclusion


Go anyway already here, he has already taken off. It is already used, it is already quoted, it is already needed. You can turn up your ass for a very long time and swear at the lack of generics, but the hour to go has already come. However, it is important to understand who and why Go should be eaten. If you are not a corporation or a startup that develops smart network petaclusters metaparadigms, then you most likely do not need Go, specifically for you. Noooo you should be in one of these offices, Go definitely come in handy. Learn to go, boys, it's worth it.

Thank you for your attention,
Ilya.

Source: https://habr.com/ru/post/274099/


All Articles