3 ms·
Definitely nothing bad can ever happen with complicated programming techniques. https://pbs.twimg.com/media/C6l_OwSXAAA_Fmo.jpg:large https://pbs.twimg.com/med
by vegai_ 5y ago
Definitely nothing bad can ever happen with complicated programming techniques.
https://pbs.twimg.com/media/C6l_OwSXAAA_Fmo.jpg:large https://pbs.twimg.com/media/C6l_OwSXAAA_Fmo.jpg:large
- ogogmad 5y agoI think generics on their own are very simple, bordering on second nature. Their interaction with traits (or "interfaces" as some languages call them) can make them complicated. I guess Go needed to find a way to make that interaction work. By generics "on their own", I mean essentially the Hindley-Milner type system, which supports generics and can do static type inference in linear time: https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_sy... Somehow, the "generics wars" in Go made generics into the scapegoat of programming language complexity, when perhaps it was Go's "interfaces" feature all along. Maybe the enemy was here the whole time!
- liftm 5y agoIs there anything in Go that will help prevent those things that definitely can never happen?
- oblio 5y agoWishful thinking :-D
- deepsun 5y agoPeople used to blame Java for that.
- oblio 5y agoYeah, ramp it up to all the way to 11, C++. Or as they call it, "strawman". I don't think many people would call Java 1.5 or C# 2.0 super complicated. Do you know what Java 1.5 and C# 2.0 had in common, that Go didn't? Generics. For reference: - Java 1.5 - release date: September 30, 2004 - C# 2.0 - release date: January 22, 2006 That's ~18 years ago and 16 years ago, for whoever's keeping track.
- foldr 5y agoGenerics ended up making Java's type system unsound. Not a huge deal in practice, but the following paper sheds some light on just how complex Java's type system really is one you start poking around a bit: https://dl.acm.org/doi/pdf/10.1145/2983990.2984004 https://dl.acm.org/doi/pdf/10.1145/2983990.2984004
- oblio 5y agoWell, it's even worse than that, they caused a breaking change in Java and 2 parallel type systems, if you can call them that, with primitives. They did the same for C#, where 2.0 was a breaking change from 1.1. I still think Go should have bitten the bullet earlier. Though I'm still glad they're doing it now. Just that now there's a ton more code and they're going to divide the ecosystem until adoption is widespread, from the stdlib to every minor corner of the ecosystem that needs it.
- EdwardDiego 5y ago> Well, it's even worse than that, they caused a breaking change in Java What breaking change? They implemented type erasure specifically not to break existing code.
- oblio 5y agoBad wording, sorry. It was breaking for C#, for Java I wasn't breaking, just ecosystem diving. For example, Hibernate still doesn't use generics fully, from what I remember (they had their half baked system from before). Adding them later is such a big change that touches so much code you can date it into pre generics/post generics:-)
- steveklabnik 5y agooooh fun, this one is mine :) I've had this happen.... three times? In my nine years writing Rust. It exists, but you aren't forced to even use things like this; this is because this particular library is trying to stretch the type system as far as it can go.