[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Is go good or not?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 54
Thread images: 8

I want to hear your opinions, /g/.
>>
determining if go is good is left as an excersise to the reader.
>>
File: cover.0[1].png (140KB, 500x834px) Image search: [Google]
cover.0[1].png
140KB, 500x834px
Sure, if you're a bicycle helmet-wearing mongoloid.
>>
>>62222321
Go is a dumbed down version of C with some nice things.
Google needed a system programming language with the speed of C but _safe_ thus Go was born, and because it is _safe_ you can program larger projects with different people.
I like that functions can return multiple values without using unsafe pointer trickery but I hate this:
f, err = fopen("op_is_a_faggot");
if err != nil {
// such advanced error handling
}
>>
>>62222647
would you rather use exceptions?
if so fuck you.
>>
It's aight but it would be great if it had generics. Having to write a queue implementation for every single type I want to use is infuriating.
>>
>>62222725
can't you use interfaces?
>>
Go is good if you're a code monkey at google. There are better options for everyone else
>>
>>62222797
what alternative guarantee employment or high worth?
>>
>>62222825
Java
>>
>>62222825
C or C++
>>
>>62222874
how much worth?
>>
>>62222825
From my experience, dotnet or Java will get you a job in big organizations, startups tend to use whatever's hot shit on HN at the time they're deciding what to use
>>
>>62222887
and which for high worth?
>>
File: QTWthpq.jpg (131KB, 1190x1698px) Image search: [Google]
QTWthpq.jpg
131KB, 1190x1698px
>>62222321
>>
>>62222898
Probably R because you weren't an idiot and became an actuarian
>>
>>62222825
>>62222881
>>62222898
high worth comes from not being a fucking brainlet and being able to learn any language or framework needed for the task in less than a week
>>
File: b70.gif (47KB, 408x410px) Image search: [Google]
b70.gif
47KB, 408x410px
Build a web app using go and you'll see that its good.
>>
>>62222321
It's good if you're a women or sub-90 IQ nigger.
>>
>>62223042
what do you mean
>>
>>62222647
And I dislike using errno, reading through integer error codes for everything and cutting integer range to have a negatives for one or two error codes. Go's err and multiple return values is consistent. Ignoring exceptions, I still think it's better than enums ala Haskell/Rust/whatever, those create even more horrible patterns.
>>
I find that limiting the language by not offering exception management systems like throw/try/catch is bad since it limits its possible applications.
>>
Therefore i find go too simplistic and unnecessarily restrictive since I can create go's exception management system in C++. Also the whole generics meme (assuming they don't change their minds about that).
>>
>>62222647
But C is okay
 Foo* f = malloc(sizeof(Foo));
if(!f){
//advanced error handling here
}
//elsewhere
if(!initFoo(myfoo)){
//advanced error handling here
}
>>
Rust is better.
>>
>>62223800
I find Rust needlessly verbose even compared to C++.
>>62223776
goto error; :^]
>>
File: 1496988331440.jpg (20KB, 239x255px) Image search: [Google]
1496988331440.jpg
20KB, 239x255px
>>62223138
My day job is backend web development using golang. I've written web apps using PHP, JS, RoR. PHP / JS become maintenance nightmares and rely on so many external dependencies that bugs are hard to isolate and eliminate. RoR is easy on maintenance but runs slow as dirt.

Go is a little extra work upfront but scales magnificently and bugs are almost always due to sloppy programming and not some weird edge case. This makes them easy to find, and even easier to fix. It also means that bugs are far more rare in the first place.

You can write almost the entirety of a production ready application using only the standard library so there is no constant search for "the best xyz package / gem" for things that should be built into a modern language. since most or all of your code is written by your dev team you never have to worry about some essential dependency not being updated quickly enough or the maintainers up and leaving.

Go is simple by design, and anyone with a decent understanding of programming can be proficient in days not weeks.

When you take into account all the extra features, you get a language that can run anywhere without a VM, build almost anything, and is incredibly stable. In just ten years its 100% production ready and is used in heavy duty commercial applications with next to zero problems for the underlying businesses.

Compare that with PHP, Node, or RoR, where the languages and frameworks have been around for much longer, but anyone who works on such a system is constantly complaining.

Meanwhile, you don't hear much from "Go brainlets" because their code just works. There's nothing to talk about. The one complaint you hear is the forced error handling. Which anyone who writes go professionally will tell you is a godsend. I don't have to review the code of my colleagues and check that they have handled errors - Go and the compiler have done it for me.

Took me a 10 days to write an API from scratch in Go with no prior training.
>>
File: 1487384605908.jpg (368KB, 894x894px) Image search: [Google]
1487384605908.jpg
368KB, 894x894px
>>62222321
It is great code to read, god awful to write for my uses. I stopped using it:

- Unused imports is an error (this can be fixed with an editor extension to manage it for you).

- Unused variables is an error. This is incredibly annoying when you're trying to implement an algorithm from a spec or porting code over from another language. You can't run or write it piecemeal, otherwise the damn thing won't build.

- Due to lack of generics, the standard library is annoying. Say you want to get the max of two numbers. You can either:
a.) write the function yourself for the data types you need
b.) Cast them to float64s, call the standard Max function, then cast them back to the data type you're using.

- Number types are all incompatible. While it sounds good in theory, assigning a smaller type (like an int32) to a bigger type (like an int64) requires a cast. C# does it better where you only need a cast when things narrow, because that's where the errors come in.

Overall it has great libraries and an active community, but using it is so fucking frustrating I just went back to (modern) C++.
>>
File: traumatized.png (263KB, 621x467px) Image search: [Google]
traumatized.png
263KB, 621x467px
>>62224087

On top of all this, Go is tightly integrated with Google App Engine. Their logging system, traffic balancing, server scaling, IP address management, and support team blow AWS out of the water.

Production apps that have hundreds of thousands of daily users NEED this stuff and if you use AWS or your own server you are also going to need a small devops army as you grow larger. Your site might be scalable but your company's wallet probably isn't.

In summary:
Millions of concurrent users? [x]
Easy maintenance? [x]
Legible code? [x]
Cross platform? [x]
Easy deployment? [x]
Useful for things other than webdev? [x]
Fewer / nonexistent runtime errors? [x]
Small learning curve? [x]
Hipster bullshit? [ ]
Elitism? [ ]
Married to OOP / FP ? [ ]
>>
>>62224239

> Unused imports is an error (this can be fixed with an editor extension to manage it for you).

> Unused variables is an error. This is incredibly annoying when you're trying to implement an algorithm from a spec or porting code over from another language. You can't run or write it piecemeal, otherwise the damn thing won't build.

Alerts you and forces you to get rid of or comment out dead code. How is this a problem?

> Due to lack of generics, the standard library is annoying

True.
>>
Go is the best programming language.
>>
>>62224431
>Alerts you and forces you to get rid of or comment out dead code. How is this a problem?

Alerts are perfectly fine, forcing is not.
I get what they are trying to do, but it makes it so you can't use the language for exploration.
>>
>>62222697
Do it in a Monad (Either or Maybe).
>>
>>62222321
I know a few languages (Haskell, Go, C, C++, Java, Scala, Clojure, Ruby, Python, Elixir, Javascript).

Go is a fine language, but the error handling patterns get annoying. Rust looks nicer, but I've never tried it. If you're interested in Go, learn it. Knowing C already, it only took a couple hours of reading and experimenting before I was productive in Go.
>>
>>62225327
By the way is scala good or should I just learn regular java?
>>
>>62225358
scala's kinda missed the boat as far as adoption goes. Learn java first to get a job, then probably kotlin will be the next Big Thing on the jvm.
>>
>>62224239
> I just went back to (modern) C++

t. masochist who was raped by his uncle at 8 yo
>>
File: 1501096052801.jpg (188KB, 730x1945px) Image search: [Google]
1501096052801.jpg
188KB, 730x1945px
>>62222321
Golang's fucking antiquated garbage. Its designers are stuck in 1970s and haven't added any new features to it.

It's also autistic... in a bad way.
>>
>>62225218
This. Monadic error handling is comfy as fuck.
>>
It has the most retarded way to parse dates in any language.
>>
>>62228014
not to mention it has the most retarded json encode/decode function
>>
>>62222321

Go is basically "Java for Hipsters" or "C for noobs". You could also call it "HTML for Algo-style languages" or "How to point and click your way through".

It's not bad, but it's not good either. It's extremely powerless (weak operators and data structures), explicit to the point of being anally retentive and dead simple. If you know C, you also can learn Go in two days.

So I suggest you look into it and make a toy app, but it has neither the concurrency power of Erlang nor the raw power of C and it's also not suited for large scale applications like Java is.

But to be fair: it's fun to use, and if you only have a simple backend (where you don't need advanced libraries) or a simple concurrency problem, it's not bad.
>>
>>62224087
You can isolate business logic just fine in node applications, just that common practice in the js world is really poor design with lots of outgoing dependencies. Using typescript interfaces and DI you get fully modular decoupled code.
>>
>>62224087

>Compare that with PHP, Node, or RoR, where the languages and frameworks have been around for much longer, but anyone who works on such a system is constantly complaining.


This is a really bad comparison.

PHP still leverages about a million times more sites Go ever will. It's not beautifull, but it works.

RoR has influenced almost every MVC framework afterwards. And it's still unbeaten in how fast you get a simple CRUD app up and running. It's not for high performance servers, but the development speed is the fastest you can have.

Node is not my cup of tea, but there are enough big sites that use it. Also it's not really a "web framework", it's only backend JavaScript.

Go has the advantages you praised it for, but you have to do everything for yourself. Sure it is fun to use, but it's not the holy grail.
>>
I really want to learn Go but Python is just 2ez
>>
>>62222321
GO hang yourself.
>>
>>62222777
Defeats the whole purpose of having types in the first place.
>>
>>62222321
Go is dumb, Go is doomed to success.
>>
it's net/http library is faster than PHP / Ruby / Nodejs but it's a shitty language. Maybe they improve it in v2.0
>>
>>62222535
is that meant for elementary school kids?
>>
>>62229992
>golang
Yes.
>>
>>62229942
>golang
>v2.0
If you knew the background of golang's creation, you'd never ever think of a v2.0. They'd do a whole another language rather than making a v2.0.
>>
>>62229942
Go is pretty fast https://www.techempower.com/benchmarks/
Go is marginally better than the languages you mentioned because it is statically typed.
>>
>>62227871
>slow building code

What the fuck does this even mean? Nobody "builds" the code for backend web services. You just write them and open a port, fuck.
Thread posts: 54
Thread images: 8


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.