3 ms·
> What languages in your opinion have good, non-tacked-on generics? It's cliche, but it's clear that generics like Result ( https://doc.rust-lang.org/std/resul
by SideburnsOfDoom 5y ago
> What languages in your opinion have good, non-tacked-on generics?
It's cliche, but it's clear that generics like Result ( https://doc.rust-lang.org/std/result/ https://doc.rust-lang.org/std/result/ ) and Option ( https://doc.rust-lang.org/std/option/ https://doc.rust-lang.org/std/option/ ) are fundamental to Rust's design from the start.
> some pretty successful languages that gained generics after maturity
I'm very familiar with C#, of course it is a "pretty successful language", no kidding. I did not say otherwise, I said that there are "compromises" associated with adding generics in V2.
And there are: e.g. starting with collection types, interfaces and base types in pairs, such as List<T> and List, IList<T> and IList, IEnumerable<T> and IEnumerable, etc ad nauseam. Then Delegates that precede Func<T> and Action<T>.
I suggest that you reread my comment above; the point is not just that adding generics later causes complication (historic record is clear that it does).
The point is that generics were _not_ proven in mainstream OO programming when c# 1.0 was released in 2002, but this has changed; now they are. Designs done in the last few years can avoid this complication: Ether your language wants them from the start, or it intends other ways to deal with the same kinds of problems.