Is it worth it to learn Go?

I want to rewrite a shell script that's gotten too long to be a simple shell script since it uses API calls and stuff.
I have heard very good things about Go, that it has an easy syntax and it's extremely fast. Is it worth it to learn that instead of writing in C++?
Also, can I trust google not to spy on me with a fucking programming language?

Attached: Golang.png (1576x890, 65K)

Other urls found in this thread:

youtube.com/watch?v=ZACOc-NwV0c
myredditvideos.com/
twitter.com/SFWRedditImages

if you already know C++ you'll have little issue adopting go
just do the tour and read the effective go page, can easily be done in an afternoon

Go is a million times simpler than C++. You can know Go very well in a week. You can be productive in < 1 hour.

It's fast, simple, easy to learn, has the best documentation ever produced for anything, and the trannies hate it. You cant ask for more

Go is really good for spinning up microservices and web servers, other than that there’s a better language for each use case

Definetly. Thinking of doing it myself.
I have to parse a 27mb json and nodejs won't cut it.

It suffers a few glaring problems:
> goroutines are too magical and retards end up writing shit code
> inconsistent syntax
> deployment is theoretically ez pz, but practically it's really not
> lack of decent frameworks (Gin Gonic is like the ExpressJS of Golang)
> procedural programming is nice but it becomes a mess once your apps start getting larger (and no, not everything has to be broken down into a microservice)
> GoOgLe is eViL
One clear upside I see with Golang is that it has an excellent standard library

>the trannies hate it
qrd? I thought go was regarded as a tranny language (in comparison to c)

>and the trannies hate it. You cant ask for more
Most faggot thing I've read to day. Well done, faggot.

just use Lisp

>has the best documentation ever produced for anything
No it has not. It is just easy.

dilate

>dilate
Speak English, dumb zoomer nigger.

I would use Perl for that. Go is nice but is actually frustrating to write with. It's more like C++ or Java in its formality: a lot of the library functions return two values, and you have to handle both of them. Well, not exactly, as you can choose to ignore one, but ONLY IF you have predeclared the variable that's getting the other value. The problem is, a lot of the variables have long names so they are expecting you to create most variables with what's in essence an "auto" keyword. And you can't instantiate an auto variable of a dropped value from a function.

This sort of shit permeates the language and feels like it's actually just fucking with me. I think they designed it to fuck with new coders to whip them into shape.

Perl offers an extremely easy way to drop down into executing shell commands while calling APIs and so on. I think Go would be a lot more tedious to do that with, especially with its goofy distinction of strings vs array of bytes vs arrays of "runes". If you don't want to use Perl, C was designed to be used with Unix and shell capabilities are built right into it: the entry of every C program gets passed a string of command line arguments you can use, and also easily pass back out for piping. Perl was also designed with Unix and C in mind so it's also great for this.

Go just isn't

It has garbage collection.
But unlike rust it doesn't pretend that GC makes your program safe.

Its not extremely fast, about on par with java, but its childs play to spawn hundreds of "threads" that consume data from channels, far easier than implementing parallel processing
I found it really easy to learn so far

>inconsistent syntax
true for pretty much any language but less so for golang with fmt's enforced styles
>deployment is theoretically ez pz, but practically it's really not
how come, it takes a second to produce standalone binaries for all kinds of archs/os', especially for glorified scripts

>> GoOgLe is eViL
Shut the fuck up faggot, I don't care if Google is evil, I care if they keep data on everything I'm doing. i.e. I would like them to not log
>Request timestamp
>Client IP address
>Full request URL, including:
>service domain, e.g. proxy.golang.org
>URI path being requested
>Response latency
>Response bytes sent
>Response code sent
>The response returned by the go command when it runs in our systems
>Whether the request hit our frontend cache
>Whether the request hit a cache elsewhere in the system (but not the frontend)
>Name of the Google machine that processed this request, e.g. machine101
For any of the thousands of requests that Go makes manually and automatically.

Not a single one of my C compilers keep logs.

Rust DOESN'T have garbage collection.
Rather, it follows a different memory model with ownership.

>Rust DOESN'T have garbage collection.
Bわははははははははあh

>true for pretty much any language but less so for golang with fmt's enforced styles
- structs don't need commas while writing but do while initializing
- function return values have to be parentheses but the actual return doesn't
- var or walrus - choose one
- while loops are called "for", and although I understand where
they're coming from, it nevertheless seems retarded to me

And believe me, I don't complain for the sake of complaining. If that were the case
then I would have also pointed out how types are written after the variables/parameters

>how come, it takes a second to produce standalone binaries for all kinds of archs/os', especially for glorified scripts
You're right. If you're only building CLI apps, then go for it but even then I'd rather just use Rust.
When it comes to the web, it's really not as simple as putting a standalone binary on a server of your choice.

Why would Rust "pretend" that "GC makes your program safe"? Rust doesn't have a garbage collector... Oh wait, you're retarded aren't you.

>Well, not exactly, as you can choose to ignore one, but ONLY IF you have predeclared the variable that's getting the other value
func myFunc(x int) (int, error) {
if x < 0 {
return 0, fmt.Errorf("Illegal argument: %d", x)
}
return int(math.Sqrt(float64(x))), nil
}

func main() {
x := 10
xSqrt, _ := myFunc(x)
fmt.Println(xSqrt)

y := 25
ySqrt, _ := myFunc(y)
fmt.Println(ySqrt)
}


What's the problem?

>And you can't instantiate an auto variable of a dropped value from a function.
what does "dropped" mean in Go? The word never appears in the book nor the spec.

Oh yeah, it's the opposite. (This is why I am not a huge fan of it - difficult for me to remember what you can and can't do, like C++). What you can't do is only gather one of the two variables from a returning function. If you declare X as an int, and then try to get only it from myfunc, it doesn't work. It encourages auto variables, which I do not like. By "dropped" I'm just talking about the "_" return variable, indicating you want to drop instead of collect the error variable myFunc returns. Who knows what they called this action? Rob Pike calls copying "snarfing" so I cannot predict what he would have named this capability

Exactly. Who came up with this retarded idea of two values all the time?
At least in languages like C#, Swift and Rust, there's a thing called nullability -
the possibility that a value could be nothing and you need to handle it accordingly.
With Golang you are constantly forced to wipe its ass. Like nigger just throw an error
WHEN you shit your pants, don't force me constantly check WHETHER you have shat your pants.

>I want to rewrite a shell script that's gotten too long to be a simple shell script since it uses API calls and stuff.
Go is worth learning, but the obvious choice for this is Python. Use that instead, it's perfect for scripts that are getting too complex for shell. Go is not designed for this, it has different strengths.
(Ruby and Perl are also suitable but not as common as Python nowadays.)

>One clear upside I see with Golang is that it has an excellent standard library

I don't understand how people can keep peddling this shit. Go has one of the shittiest, most anemic standard libraries I've come across.
Take the std lib mux for example. There's no regex prefix routing, no extracting parameters from urls eg., /users/:id/details, no simple middleware use/reuse for groups of routes, shit performance,...

>It's simple
Simplistic != simple.

Go is absolute trash for anything other than small standalone programs.

>dilate

>youtube.com/watch?v=ZACOc-NwV0c