News for hackers. Stuff that matters.
Re:Go 1.18 by saurik on Tuesday March 15, 2022 @09:59PM (#30694393)
This 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).
Re:Go 1.18 by jshen on Wednesday March 16, 2022 @12:33AM (#30695347)
I’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?

Re:Go 1.18 by pie_flavor on Wednesday March 16, 2022 @11:38AM (#30700130)
Which part of this is not generalizable to literally every conceivable complaint about a language whether it makes sense or not? Why would I want diversity between languages where you do have to copy-paste lots of boilerplate, and languages where you don't? If there was a good, simple-in-the-Go-way solution to this problem other than generics, feel free to suggest it, but repeating 'why care about anything ever' is just pure noise.
Re:Go 1.18 by jshen on Wednesday March 16, 2022 @02:36PM (#30702370)
As I've said, this isn't about generics specifically. There are a whole lot of us who find Go code bases far easier to read and understand that most other languages. We believe there is a value to the language's simplicity, and we want to keep it that way. We've written Go for years, and haven't missed many of these features you want. In fact, we think there is a decent chance that Go code bases are easier to jump into and understand BECAUSE of it's simplicity.

You have many many choices that work the way you want. Go use them, why try to dictate to us that we can't have the choice we want? We disagree about the value of these things, and their trade-offs. That's what diversity is for, you have languages that work your way. Why insist that one of the few that doesn't has become like all the others?

Re:Go 1.18 by pie_flavor on Wednesday March 16, 2022 @03:46PM (#30703147)
You are posting a criticism of the feature, in response to a comment that is an answer to that criticism.

If your code did not use generics, it can continue to not use generics. If you did not interact with any libraries whose need for generics was apparent, you can continue to do that too and the libraries you were using aren't going anywhere.

But just because you don't interact with a problem doesn't mean it doesn't exist, and the problem has historically been solved with dynamic downcasting, code generation, or copy-pasting, all of which result in codebases far harder to read and understand than most other languages. For these problems, you are not trading off generic code vs simple code, you are trading off generic code vs incomprehensible code. It is great that you have never needed a tree-map instead of a hash-map, but many have.

Go's simplicity is in many ways it being the spiritual successor to C, and even C has generics nowadays because they are an enormous value add.

Re:Go 1.18 by jshen on Wednesday March 16, 2022 @04:17PM (#30703497)
You’ve missed the point. There are trade-offs that you are ignoring. There is no hard science that proves either of our opinions are right. I believe diversity is the better path in the face of such uncertainty, I don’t understand why you are against diversity here, and you continue to not directly answer that question.

“ If your code did not use generics, it can continue to not use generics. If you did not interact with any libraries whose need for generics was apparent, you can continue to do that too and the libraries you were using aren't going anywhere.”

This shows a profound lack of understanding of software development at scale.

Re:Go 1.18 by pie_flavor on Thursday March 17, 2022 @12:28PM (#30712961)
Of course I'm not directly answering a polemic gotcha. If I work in Go, and I have a pain point in Go, and I want that pain point to be addressed, that's not being 'against diversity' or being 'for diversity'. It is being against wasting lots of time for nothing. Why are you against productivity? You continue to not directly answer that question.
Re:Go 1.18 by jshen on Thursday March 17, 2022 @04:37PM (#30715614)
Unlike you, I’ve answered your question many times. You are only looking at the benefit for a narrow use case without accounting for its holistic costs. We have a difference of opinion about those costs, and there is no hard science that can prove either of us right. I have acknowledged your point of view, and the possibility that it could be right. You have not reciprocated in any way, or even acknowledge that you understand the point I’m making.
Re:Go 1.18 by pie_flavor on Thursday March 17, 2022 @08:52PM (#30717510)
Diversity doesn't have anything to do with holistic costs. You shift between whether you're talking about holistic costs and whether you're talking about diversity depending on which part of the point you're making.

https://en.wikipedia.org/wiki/Motte-and-bailey_fallacy

Re:Go 1.18 by jppittma on Wednesday March 16, 2022 @10:03PM (#30706734)
Can't you and yours just freeze at go 1.7? That way, you get your diversity. Pretend every code base that's using go 1.8 is using java or something. A lot of us who write go everyday think generics aren't complicated and are tired or repeating ourselves.
Re:Go 1.18 by jshen on Wednesday March 16, 2022 @10:30PM (#30706955)
This shows a profound lack of understanding of software development at scale. Also, as I've said many times in the thread above, I'm not talking about this specific implementation of generics.
Re:Go 1.18 by munificent on Wednesday March 16, 2022 @04:50PM (#30703909)
> why insist that go become the same as all the other languages

You're arguing a strawman. No one insists that Go become the same as all the other languages (which are themselves nowhere near the same as each other). People are just asking for generics.

C++, Java, C#, and Haskell all have generics and are still wildly different languages even with respect to their approach to generics.

Re:Go 1.18 by alex_sf on Wednesday March 16, 2022 @02:12AM (#30695841)
Policies don't work. It's why we lean on process in fields where correctness matters, e.g. aviation.
Re:Go 1.18 by reegnz on Wednesday March 16, 2022 @06:13AM (#30697052)
Policies do work if you have a process to enforce those policies. Without policy how do you define the process? "Good intentions never work, you need good mechanisms to make anything happen." http://nickfoy.com/blog/2018/4/7/good-intentions-dont-work
Re:Go 1.18 by alex_sf on Wednesday March 16, 2022 @10:37AM (#30699365)
By designing systems that encourage or enforce the correct action.
Re:Go 1.18 by alophawen on Tuesday March 15, 2022 @10:44PM (#30694722)
I predict someone will boil up a linter tool that would block generics in your CI.
Re:Go 1.18 by majewsky on Wednesday March 16, 2022 @05:57AM (#30696969)
I 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".
Re:Go 1.18 by alophawen on Wednesday March 16, 2022 @06:18AM (#30697075)
Not sure why you would run checks on your dependencies rather than your code.