6 ms·
Disclaimer: I'm extremely happy that generics are coming to Go. > I wish I understood how people can say 'this will result in so much more weird boilerplate ga
by dimgl 5y ago
Disclaimer: I'm extremely happy that generics are coming to Go.
> I wish I understood how people can say 'this will result in so much more weird boilerplate garbage code'
It's pretty simple: there's a lot of developers that misuse/shouldn't use generics.
Here's an article I found just casually browsing on Google that shows why this can turn out to be such a huge problem.
https://itnext.io/golang-1-18-generics-the-good-the-bad-the-ugly-5e9fa2520e76 https://itnext.io/golang-1-18-generics-the-good-the-bad-the-...
- munificent 5y agoThere's a lot of developers that misuse/shouldn't use any powerful feature. If the solution is to give them a nerfed language, then you also nerf it for the users that would use the feature well in productive, useful ways.
- jshen 5y agoYes, it’s a trade-off. In an organization with thousands of developers the right trade-off is likely different than an org with 20. What I don’t understand is why people insist on making Go like every other language that already does what that are looking for. You want a language with generics, purely functional blah blah blah, great there are tons of choices, use one of them. Why insist on reducing the diversity in language choice, and trade-offs?
- pjmlp 5y agoBecause in many shops IT decides what languages people use, given the platforms, not devs. Also quitting the job isn't always an option. That is why some of us have to put up with languages that we rather not.
- erik_seaberg 5y agoThis. I joined a Java- and Scala-centric team, yet Go is continually harder to avoid for no fault of our own, so I’m glad we’ll at least have a less obstinately broken dialect.
- throwaway000811 5y agoWe change the language; people who formerly enjoyed the language now have to put up with a language they rather not. Their only option is to quit programming since there are no programming languages they enjoy left.
- pjmlp 5y agoOr they become adults and acknowledge programming languages are products like anything else and they either evolve or stagnate. Even COBOL and Fortran keep up with modern times! Yes, including generics.
- jshen 5y agoC has entered the chat
- jppittma 5y agoGo 1.7 is still around. If people can still run python2, by all means, keep fighting the good fight.
- jshen 5y agoSo you want to diminish the diversity in programming languages because it’s an inconvenience to you personally. I respect the honesty.
- pjmlp 5y agoThanks, the same way that people in Go community see as inconvenience to learn how to write better code. The old ways of code generators are good enough.
- jshen 5y agoI've been coding for decades. I've written large scale systems in functional languages. I was a believer, but after many years of experience, I didn't find it to add a whole lot of value. I didn't find that there were fewer bugs as promised, it wasn't faster to develop and ship features, and most importantly, it was hard to jump into other peoples code and make sense of it. You might have a different opinion, that's fine, you have tons of languages that work the way you want. That's what diversity is for. Yet so many of you want to remove that diversity for a reason that I don't understand. There is no science that has proved which of us is right, so the best option in my opinion is to let diversity flourish. I can't understand why you all are against that.
- pjmlp 5y agoApparently the Go team has themselves admitted that we are right and they were wrong. Go is open source, create your own fork without generics and lets see which version keeps going.
- jshen 5y agoWe must be talking past each other, and maybe we don't disagree all that much. I'm not talking about generics in this form, and I think the Go team did a good job in their approach and implementation. However, you can read in this thread many people that are demanding more, specifically with the generics implementation. It's not good enough because you can't create monads, do purely functional programming, etc. I'm hopeful that this implementation is hitting the sweat spot, and that the Go team won't chase the demands to make Go like many of the other languages. I think the biggest win for Go is not having class based inheritance. Fortunately, I haven't seen anyone demanding that.
- saurik 5y agoThis is what policies are for, not entirely new languages: if you don't like generics and don't trust the end developers at your organization to not use them in stupid ways you should maybe (I say "maybe" as this problem just seems so lame of a problem to have: if your army of end developers can't be trusted then you should fire them and hire some real developers) have a way to turn off generics that isn't "use a language that doesn't support them at all" (which I will note is itself nothing more than a policy decision anyway).
- alophawen 5y agoI predict someone will boil up a linter tool that would block generics in your CI.
- majewsky 5y agoI also predict it will be practically useless since those five libraries that you absolutely depend on will all be rewritten to take advantage of generics, and then you're left with the lose-lose situation of "maintain a fork of the last non-generics version myself" or "get stuck on the last non-generics version and never receive security updates again".
- alophawen 5y agoNot sure why you would run checks on your dependencies rather than your code.
- jshen 5y agoI’m not talking about generics specifically. I’ve been coding for decades. Go is by far the easiest language I’ve used when it comes to jumping into an arbitrary code base and making sense of it. Again I ask, why insist that go become the same as all the other languages when you can just use one of those? Why demand less diversity?
- pie_flavor 5y ago
- kitd 5y agoThe syntax isn't the only driver of language popularity. Ecosystem/ tooling/ major sponsors/ large precedent projects etc all enhance a languages adoptability and big shops want to pick a language with a low risk and large supply of coders.
- alex_sf 5y agoThat was one of the goals and virtues of Go imo; the language was nerfed. It made the hard things easy, and prevented the really hard things from being implemented in silly ways.
- closeparen 5y agoIt guarantees that when people do things in silly ways, their silliness is splayed across so many characters and lines that you'll never have the time to change an appreciable portion of them.
- fulafel 5y agoLanguages are very powerful in shaping expression of programmers, new and experienced. Limiting expressivity is how we eg got from assembly programming to structured programming. Same memory safety, garbage collection, etc..
- ta20200202 5y ago> there's a lot of developers that misuse/shouldn't use generics. The same is true for other features, like channels and goroutines.
- metadat 5y agoGoroutines and channels seem comparatively simple compared to the representational symbolic changes involved with generics, which make the code look and read more like Greek. The beauty of Go is (was) largely in its simplicity and python-esque (or maybe better than python) readability. With generics, reading and reasoning about code becomes [even] more challenging. Personally for me, at this juncture I'm finding that for new projects I might just as soon spring for Java or maybe even prefer it to Go. For the straightforward mvn-style dependency management, if nothing else. It's all moot now, though. There's no going back, this puppy is cooked!
- alophawen 5y agoI spent 4 months in '21 rewriting a golang backend to properly use channels for concurrency. The previous developers did misuse it and left a steaming pile for me to find. However contracting pays well, so I don't care. You might want to reflect on your reasons for jumping ship because your tooling gained a new feature. Sound's rather irrational to me.
- metadat 5y agoIt's more about the direction and trajectory, Go used to be fun for me but the appeal has waned. Sounds like it's just me.
- alex_sf 5y agoIt's less that it gained a new feature, and more (the fear at least) that it made a change for the worse. Avoiding updating to a new version of OSX that stabs you in the face is a reasonable thing to do, despite it being a new feature.
- 5y ago
- rr808 5y agoMy view is there should be official libraries with generics, but regular developers shouldn't be allowed to write any.
- bashery 5y agoagree +1
- deleted 5y ago[deleted]