3 ms·
templates are definitely more powerful than Rust generics. And "enterprise" Rust code can easily become so infested with traits it's as unreadable as C++ templa
by forrestthewoods 5y ago
templates are definitely more powerful than Rust generics. And "enterprise" Rust code can easily become so infested with traits it's as unreadable as C++ template spaghetti. STL is a special level of unreadable. But "enterprise Rust" might be worse than "enterprise C++" at times.
I am curious, what are some actual things you have done with templates that you couldn't do with generics? I'm pretty firmly in the camp of "most of C++'s strengths over C are bad". So I'm struggling.
I'd maybe possibly say C++ templates are better for math? Which is true. Rust generics are not great for complex math. However eigen is nightmare monster that absolutely ruins my compile times so I'm not sure whether this counts as a win or loss for templates. Maybe a bit of both.
Rust is still duper bad at UI. Even if there are some imgui-like Rust libraries doing cool things. I've never seen a C++ GUI library that didn't suck horribly. But at least it was possible.
- pjmlp 5y agoTraits, macros and crate features actually.