2 ms·
> That said, most of the complaints I hear about generics are about terseness rather than correctness (i.e., people want to elide lots of little bits of boilerp
by hardwaresofton 5y ago
> That said, most of the complaints I hear about generics are about terseness rather than correctness (i.e., people want to elide lots of little bits of boilerplate), which is perhaps why I don't find myself missing generics very much--I'm happy to put up with verbosity as long as correctness and readability are preserved.
Agreed, and I have to confess that it takes a lot of restraint for me to not suggest that people just change the languages they do generics and type programming in (in favor of haskell/rust). Proper algebraic data types, typeclasses + constraints instead of inheritance, good concise syntax -- there are better type systems out there but most people have only used Java/C# (which is fair since most enterprise software is written in those languages).
- gher-shyu3i 5y ago> Proper algebraic data types, typeclasses + constraints instead of inheritance, good concise syntax -- there are better type systems out there but most people have only used Java/C# What's ironic is that both Java and C# are getting ADTs (sum types) and pattern matching. Java already gives you exhaustive pattern matching with the upgraded switch statement. I think C# has a proposal for an HKT-like capability, though not sure how far along that is or how much of a priority it is.
- hardwaresofton 5y agoIt's like merecedes and the car world -- the good features get passed down from the research languages to the pragmatic get-shit-done and enterprise languages, this is how the system is supposed to work, I guess.
- gher-shyu3i 5y agoTrue. What's sad is that we had already known that generics, proper error handling, and enums were a good thing when golang was first written, yet they were purposefully ignored.
- throwaway894345 5y agoI get that. The important bit is that there are a lot of other important concerns besides the type system--tooling, ecosystem, ease of finding/onboarding collaborators, etc. Personally I think Rust is the only of these languages which ticks most of these boxes, and even then Rust makes you think about ownership all the time. I think there's space for a GC'ed Rust ("Rust-lite") or an OCaml with a familiar syntax and really great support (last I checked, ReasonML is still a confusing mess). Maybe Go will get generics and sum types and it will be close enough?
- hardwaresofton 5y ago> I get that. The important bit is that there are a lot of other important concerns besides the type system--tooling, ecosystem, ease of finding/onboarding collaborators, etc. Personally I think Rust is the only of these languages which ticks most of these boxes, and even then Rust makes you think about ownership all the time. I think there's space for a GC'ed Rust ("Rust-lite") or an OCaml with a familiar syntax and really great support (last I checked, ReasonML is still a confusing mess). Yeah, I personally use Typescript when I want something that I can work with others but not slow down newcomers/other team members too much. Perfect world it's Haskell or Rust but in the real world usually Typescript. > Maybe Go will get generics and sum types and it will be close enough? I think this is what will happen -- basically Go is doing the mongo thing where you just launch with something that is mostly good (Go is way more than mostly good for what it sets out to be), and you just iterate till you get something that is way better, and you just have to out-market/last your competitors. A bit of a detour but most people have never heard of RethinkDB which was like Mongo, but more correct (see Jepsen tests), could shard easily out of the box, came with an admin UI, and did live streaming of updates. By all accounts a better product, but Mongo just marketed their way to dominance and iterated/bought their way out of a bad product (see: WiredTiger).