News for hackers. Stuff that matters.
Re:Native GUI library for Go by sdegutis on Friday June 06, 2014 @01:00PM (#7859057)
I just know that generics are helpful. Not just a convenience, but genuinely helpful. And it gives a kind of help that can't easily be replaced by a new library or third party tools. Which, to me, makes generics a very welcome language addition. You could very well code big and small projects without them (and I have too). But that doesn't negate their utility.
Re:Native GUI library for Go by stcredzero on Friday June 06, 2014 @01:44PM (#7859310)
Not just a convenience, but genuinely helpful.

Specifically, how?

EDIT: Surprisingly, programmers do a lot of this "just knowing." You'd think that a supposedly quantifiable field would have more, quantification. Going by "guts" is particularly bad in big enterprises, where decisions are often more about politics than about quantifiable results.

Re:Native GUI library for Go by Someone on Friday June 06, 2014 @04:16PM (#7860071)
I can guess what he hints at. If you don't have generics, you either copy-paste-replace common data structures, or you implement them for the equivalent of void .

The former means more code. That can be hidden out of view, but it means more work when fixing bugs in that code, introduces subtle bugs when one forgets to apply a bug fix to a 'copy', and slows down compiles.

The latter means adding casts to your code that make it harder to read and (more code is buggier code) also runs the risk of introducing bugs.

The two-and-halfth option is to use some preprocessor to generate code variants for you. IMO, that is just a bad implementation of generics.

Yes, that is not quantified, but I think it covers the how* part.

Re:Native GUI library for Go by AlisdairO on Saturday June 07, 2014 @03:24AM (#7861552)
Casting (for example) is a pain, but to me the best aspect of generics is the documentation they provide of the types involved with a given piece of code.