"I'm glad I'm not the only one sad to see generics invading a perfectly good language"

What is wrong with the Go cultists? It's fucking amazing to me how "generics are an untested and dangerous innovation" became a common, acceptable opinion. I don't mean to call all Go programmers cultists. There are some who understand the value of generic data structures and functions and either want them in Go or don't. They are fine. But the fuck is up with those who act like the 1970s never happened, other than C?

Attached: go.png (828x613, 100K)

Other urls found in this thread:

go.googlesource.com/proposal/ /master/design/go2draft-generics-overview.md
emilymaier.net/words/getting-specific-about-generics/
youtu.be/sX8r6zATHGU
youtube.com/watch?v=sX8r6zATHGU&t=3029s
go.googlesource.com/proposal/ /master/design/go2draft-error-handling-overview.md
twitter.com/AnonBabble

Rob only said generics weren't a priority and for the most part disposable. The truth is Go is incredibly comfy. The true Go community is cat -v, not Reddit.

Attached: go comfy.png (409x409, 139K)

>The true Go community is cat -v, not Reddit.
Why, that's even worse.

>Goo
>perfectly good language

Attached: 1485885868574.jpg (1024x764, 70K)

this is the picture of author of that statement

Attached: brainlettttt.jpg (200x200, 12K)

might take another look if those error handling constructs get added, go makes java look beautiful, fucking disgusting

Generics are basically training wheels. They might look like the shit to junior devs, but are only a hindrance when it comes to writing solid quality code.

...

So Go's basically the result of stapling C's garbage syntax and lack of features to structural typing and greenthreads, right? Why the living fuck would anyone program in such a language?

>to structural typing
nah.
a better way to think about golangs type system right now is type avoidance, as in tax avoidance

I had the impression that interfaces meant something; are they actually more like void* s?

There is an empty interface that you basically can use like a void pointer. Which almost every project does at some point.

>Spending $150 just to not close your unused programs

In go.googlesource.com/proposal/ /master/design/go2draft-generics-overview.md Russ Cox wrote
>In retrospect, we were biased too much by experience with C++ without concepts and Java generics. We would have been well-served to spend more time with CLU and C++ concepts earlier.
What?

What's your point? He just said looking for the good way to design Go generics was hard because they weren't looking at languages with good generics.

The true reason Go doesn't have generics is because generics are too confusing for Google employees.

Attached: rob pike on golang.jpg (1024x683, 253K)

Kek, this is perfectly accurate. Can't understand how this language ever gained traction, even though it's supported by cuckle

Attached: 1529902597240.jpg (700x963, 94K)

Go devs have repeatedly stated that they won't add generics to the language until they can find a non-shit way to implement it, and that they are open to receiving proposals, i.e., patches are welcome.
If you are so smart, you could do it... can't you?

>Why the living fuck would anyone program in such a language?
Well, LOTS of people develop in Javascript, Java and C++, Go with all it's faults is a breath of fresh air compared to those.

Here's a recent PRO generics article from a Go developer, who also makes good points about the shitshow known as templates.

emilymaier.net/words/getting-specific-about-generics/

Something tells me that a google dev's definition of what is "not shit" is bound to be wildly different from the rest of the world. These are the people that brought us such things as unused imports being a compiler error.

I dont think generics are bad, but they will introduce even worse practices in Go. People use generics everywhere they shouldn't because OOPsies are fucking idiots.
Procedural programming leads to very clean and fast programs. Generics lead to technical debt.

If by "clean and fast" you mean "verbose and RSI-inducing to write".

If you want simple instructions and don't care about repetition, go write ASM.

How frequently are you writing non-specialized containers, exactly?

Obligatory post.

Attached: go_doesnt_need_generics.png (920x379, 42K)

FTFY

Attached: 1535913198686.jpg (643x553, 60K)

youtu.be/sX8r6zATHGU

youtube.com/watch?v=sX8r6zATHGU&t=3029s

something tells me you believe "being a man" as a programmer means making things difficult for yourself instead of doing what you are supposed to do: to build useful programs that just work™

The fuck are you jabbering about?

Here's an example - having to write `if err:= nil {}` every other fucking function call. In sane languages, if you have a function call blow up, it passes an exception that can be caught at the block level.

Postfixing every single function call with an if is moronic. Utterly fucking moronic.

Nobody needs an 'ImmutableTreeList' in go, thats for fucking sure.

>characters from the Canadian Aboriginal Syllabics block
>it's fucking real

Thanks, user, I needed that laugh

and you can't even put it on one line because go's if statements are so opinionated

>they weren't looking at languages with good generics
That's exactly my point. Many people made the same point from the start.

how come no one makes threads whining about other languages all day every day?

don't use go if you don't want to. it's really that simple!

Go error handling is being improved, here's the current draft:

go.googlesource.com/proposal/ /master/design/go2draft-error-handling-overview.md

>Visual Basic error handling
>an improvement

Honestly, I can't think of a reason to not do error handling the way Haskell and Rust do it.

Good article.

I don't know why you bother. He's here to shitpost. He will find something else to rage about. He obviously doesn't even use Go: no Go user would write """""if err:= nil {}"""""". Don't waste your time.

Yeah what a surprise. It's like Rust's "?" error handling but without the interaction of sum types.

How come everybody comes to the defense of google's favorite language when it receives the slightest criticism? Fuck off shill.

That's still about a billion times better than manually checking a return variable - especially in cases where all you want to do is note the error occurred and continue.

it's clearly a golang version of std::try! you fucking spastic

>Visual Basic error handling
isn't bad.
>the way Haskell and Rust do it
Haskell and Rust a pretty different. Honestly, Haskell's exceptions feel like a mistake sometimes. There probably shouldn't be exceptions in a lazy language.

what tipped you off, that the article has a whole section about rust?

I'm not going to expand out what was a throwaway example of needless verbosity just to sate your autism, nigger. I also guarantee I've written more of this fucking code than you have.

$ find /mnt/projects/go/src/gitlab.localdomain/ -iname '*.go' | wc -l
449

xargs wc -l that.

I think the problem is there are a lot of people giving opinions on language design that know jackshit about language design.

You can do generic programming in Go, you have interfaces after all. "Generics" is an OO way to do generic programming, inspired (or caused) by the big type taxonomies those languages tend to have, which deals with how to do generic programming on languages with subtyping and what not.

I feel like people complaining about Generics in Go are mostly just trying to shovel their OO knowledge in a language that is not OO.

>I think the problem is there are a lot of people giving opinions on language design that know jackshit about language design
>"Generics" is an OO way to do generic programming
the irony

No, you faggot, you literally fucking wrote "if err:= nil". No Go programmer would make those mistakes, because they'd have "if err != nil" in their muscle memory.

% find ~Jow Forumssrc -iname "*.go" | wc -l
4656

>"Generics" is an OO way to do generic programming,
Generics have nothing to do with OOP, the only two non-OO modern languages, Haskell and Rust, are built around generics.

Attached: images.png (185x272, 6K)

>the only two non-OO modern languages
No need to exaggerate like that. There's plenty more if you know where to look.

>I feel like people complaining about Generics in Go are mostly just trying to shovel their OO knowledge in a language that is not OO.

Or people that realize the way Go is set up, they're required to waste a lot of time doing basic bookkeeping.

Deserializing JSON or YAML or XML or (insert favorite interchange language) requires you to either define the full schema of the data you'll be recieving back (which gets really fun and not at all tedious when the docs are nested), or shove it all into a blank interface and then type the fields as you pull them out.

For bonus points, note this odd usage of the term "interface" is a go-ism.

Meanwhile, the programmer is going "Wait a fucking second. You're a JSON deserializer. You know the type of the incoming data because JSON is a pretty simple standard and you know what are strings and what are numbers because of the way things are delimited. Couldn't the computer, this wonderful labor saving device, do this for me?

rust is object oriented

traits are just interfaces
structs/enums are just objects that don't have to be boxed
no inheritance but a) who gives a fuck and b) if you really want it you can use enums or traits creatively

A compiler should warn about that and if there are more than 3 warnings or so produce an error.
Sloppy shit code should not be encouraged.

What's the point in using valid identifier names if you're going to search and replace them before compilation?

>he checks his entire src directory, including the libraries tied to stuff he hasn't personally written.

There's a reason I pulled my internal gitlab instance's directory on this dick measuring contest, nigger.

Traits are just type classes from Haskell.
>structs/enums are just objects that don't have to be boxed
By this logic C is OO.

>checked

This would be fine, but the problem is that this is an extremely unnatural workflow. Most people are going to be like "Okay, I'm going to be working with API data, so I need net/http and encoding/json" and just throw those in at the top but the autistic fucking compiler is like LAWL YOU HAVEN'T WRITTEN THAT YET.

> "Generics" is an OO way to do generic programming,
I don't know what these scare quotes are meant to imply but generics as we know them came from ML, not OOP languages.

>I feel like people complaining about Generics in Go are mostly just trying to shovel their OO knowledge in a language that is not OO.
They have a practical understanding that other people will shovel their existing OO design conventions into the language and change its programming culture if given the opportunity. Even though I wouldn't mind seeing generics in the language, this is a reasonable worry. Look at all the retards in this thread frothing at the mouth at his post, for example.

The purpose of OO is polymorphism which is difficult to do in a type-safe way in C, but not in Rust.

>Deserializing JSON or YAML or XML or (insert favorite interchange language) requires you to either define the full schema of the data you'll be recieving back (which gets really fun and not at all tedious when the docs are nested), or shove it all into a blank interface and then type the fields as you pull them out.

What statically typed languages do this differently?

OO without inheritance isn't OO.

It's actually a bad idea. Better to have invalid identifiers so that the input to your code generator doesn't accidentally compile as vanilla code.

was meant for

redditor spotted

Googlers don't even use Go
>t. Googler

>reddit user tries to distract everyone from his redditness by calling everyone else redditors

Sorry, not gonna fly in this thread, redditor.

Google is a large organization of many offices and departments across the world and it's not a surprise that you and the rest of the cleaning staff may not have used it in your job duties.

Jelly much? Google's top 3 languages are Java, Python, and C++.

Saying google doesn't use go and saying it's not among their top 3 languages are not equivalent.

it was only ever touted as some meme microservice language but really just to keep rob pike busy with his plan 9 toys so he doesn't wander off

It's orders of magnitude used less than any of the top 3 (just checked its like 10th). It isn't commonly used.

>Googlers don't even use Go
Yeah, that's why they created Kubernetes, their container system entirely in Go. Also why they use Go for large parts of their new Fuchsia OS.

But no, Google does not use Go.

Immediate error checks are just a different paradigm, theyre not worse.
Generics dont fix that either.

You can put them on one line if you want. Its just obtuse ugly ans hard to read. Same as every other bracketed language.

Im not opposed to this but their draft is fucking horrible

Saying google doesn't use go and saying it's used orders of magnitude less are not equivalent.

Also a place in a list of rankings isn't an 'order of magnitude'. Mathematical terms like that actually have a fixed meaning outside rhetoric.

Why not switch to the D?

>Saying google doesn't use go and saying it's used orders of magnitude less are not equivalent.
Keep being pedantic all you want, Google doesn't like Go

>Also a place in a list of rankings isn't an 'order of magnitude'. Mathematical terms like that actually have a fixed meaning outside rhetoric.
You realize you're retarded, right? Go is both 10th AND orders of magnitude used less than any of the top 3.

>You can put them on one line if you want.
don't think so, but i'm not a gopher

Show me a link *quantifying* usage of languages inside google, without just rankings, otherwise you're still talking out your ass.

>traits are just interfaces
Accept you can't access struct fields in traits
>enums
They are tagged unions
>who gives a fuck
People with half a brain do. Rust clearly is not object oriented, you are just being stupid.

this amazes me

you know while testing everything they themselves ran into that problem and did nothing about it.

Because there's shit developers in the world. Go was designed to appeal to mouth-breathing morons who think that the only reason why they are unable to write sensible large applications are the languages themselves.

They are old farts coupled with tons of zoomers who are getting all misty-eyed over 70s era minimalist language aestetics and pretend we didn't invent shit in last 50 years of computer science. "Oh you only slap GC on C syntax then it would be perfect". Now they are shovelling their shit like etcd, docker down our collective throats while pretending these products don't have several thousand bugs after 5 years of development, because their authors don't know jack shit about low level.

Using a low level language doesn't magically make you knowledgeable about OS shit and using error codes instead of exceptions doesn't make your programs any less buggy and shit.

Adding generics to Go would make it marginally less of a trashcan fire, but since the language attracts trash programmers, it will remain the premier language for its niche of "very popular yet somehow extremely buggy and shitty" application writing.

Attached: 1534326173004.png (1280x1092, 598K)

>"very popular yet somehow extremely buggy and shitty" application writing.
Look mom! I made another absolutely worthless statement, anything I don't like is buggy and shitty, except I can't come up with anything that validates that claim.

docker's go rewrite was an obvious cargo cult waste of time

not that guy, but google is shit. they do mediocre things and make a big stink out of it. google wave, google glasses, self-driving cars - all this PR coming out of this massive company sitting on billions of dollars. always turns out they can't really do anything anyways. they're just selling ads and sitting on a bunch of cash with no real direction or purpose, other than to buy 1 company per day.

as if that wasn't bad enough, now they're censoring news for the chinese, and have been messing with news in the US for some time. for instance, i never read the washington post or CNN, and yet I get updates from these sites on my phone.

google is valueless. supporting go, even if ken thompson is involved, is supporting google. they aren't a good company. they are just an army of dead companies, with 15 layers of bureaucracy, supported by monopolization of internet ads. google sucks big cock.

>What statically typed languages do this differently?

The point is if I can write a script that takes arbitrary JSON blobs and can spit out a valid Go struct with appropriate datatypes with no further input from me.. that there is no reason the formatter/compiler can't do this as well.

static_assert can be used to alleviate some of the compiler errors involving templates. It's not a perfect solution because you still have to write the static_assert function to check the parameters, which you might forget to do or mess up, but its a start. I think it makes it very manageable in C++

Concepts make everything significantly better. Can't wait for them to be introduced.

Exceptions are fucking shit. Checking all your error values isn't much better but a half decent language gives you some kind of error monad.

Fuck you. Go take a look at issues in github for these projects.

LOL, I'm supposed to sift through github issues in search of anything that verifies YOUR nonsense claims ?

Just stop embarrassing yourself.

Error monads > greenthreads + panics > unchecked exceptions > error codes > checked exceptions

Error monads > greenthreads + panics > checked exceptions > error codes > unchecked exceptions

>error monads > unchecked exceptions > checked exceptions
confirmed for being a fucking moron

fuck off faggot

whoops lol

I'm not familiar with the greenthread/panic mechanism though. You're saying spawn a new green thread for any can-fail sequence of computations?

>Exceptions are fucking shit.

Gimping the language and giving its coders RSI so Pajeet doesn't write awful code is shittier.

Of course you won't, there's thousands of bugs. Which is exactly what verifies my claims. The sheer number of bugs.

By calling my claims nonsense, you've also made implicit claims, i.e. that these are not shit buggy projects, which you have substantiated with nothing.

You're right, gimping your language is terrible.
That's why you should have a more powerful and more general mechanism like a monad for those things.

The 'valid go struct' needs to be defined in code somewhere for you to be able to refer to its fields in the rest of your code. The compiler can't do this for you because it doesn't know what the layout of your json looks like and wouldn't be able to typecheck any access into its members. The json package can obviously see the types and structure of the data but it's only able to do that at runtime when it's fed the json. What you're asking for isn't possible in any static language.

>The sheer number of bugs.
Compared to what ? Show me similar sized projects in other languages with the same level of development going on with substantially less bugs ? You have shown nothing, all you have is an empty claim that I'm supposed to validate.

>By calling my claims nonsense,
Your claim is nonsense since it's not backed up by anything.

>you've also made implicit claims, i.e. that these are not shit buggy projects
No I have not, I've only pointed out that your claim is utterly pointless as it's backed by absolutely nothing, just like any other blanket claim of 'X sucks'. You are literally doing kindergarden level argumentation.

It's perfectly fine to dislike Go, but use actual arguments.

t. brainlet 'googler' on damage control