2 ms·
That's true, but in the case of Tagged Union it improves safety, readability and better support for tooling, templates introduce slower compilation and noisy bu
by Kukumber 4y ago
That's true, but in the case of Tagged Union it improves safety, readability and better support for tooling, templates introduce slower compilation and noisy build error, and now you depend on the runtime, it advertise template capabilities of the language for sure, but at what cost..
Why bother with slices when you can have a template? struct Slice(T) { T* ptr; size_t len; }
;)
Another example, this time with Zig, they refuse to have interface/trait, now everyone has to duplicate bogus code, even them in their std, sure it promotes the language capabilities, but at the cost of poor ergonomics, that'll prevent their growth
- WalterBright 4y agoIndeed. D used to have complex numbers built in, but the library type turned out to be more practical.