2 ms·
>decided generics is not needed >went on for a decade The FAQ on the official site already back in 2013 (I couldn't find an earlier snapshot on webarchive) sta
by kgeist 4y ago
>decided generics is not needed
>went on for a decade
The FAQ on the official site already back in 2013 (I couldn't find an earlier snapshot on webarchive) stated they were open to adding generics but weren't sure how to properly design/implement them without overcomplicating the language, citing also other priorities.
>implemented a version of it that is not performance-sensitive
It's less performant than the ideal but it's a tradeoff to avoid exponential code bloat found in C++. In our large C++ project which extensively used templated boost.signals the code bloat from using templates alone added a whopping 200 MB of machine code which we were able to shed off by switching to our in-house library. IIRC C# uses an approach similar to Go to share generated code with some type-specific conditions at runtime (at least Mono I remember shared generic code for all reference types)