4 ms·
Having used both, I find it much easier to predict the behavior of Rust code than C++ code when metaprogramming is involved. Rust is very much against having t
by zdimension 3y ago
Having used both, I find it much easier to predict the behavior of Rust code than C++ code when metaprogramming is involved. Rust is very much against having thirty-seven and a half automatic deduction mechanisms under a trenchcoat and calling that metaprogramming. C++ has done a great job at building stuff on top of C but it's a bit like Windows 9x at this point, limited by DOS. C++ templates and resolution rules are fundamentally flawed from a UX perspective, however powerful they are. In the same vein, Rust usually has much better error locality, i.e. in C++ it's quite easy to get three pages of errors in files from the std when the error is actually in your code and you forgot a `const` or a `&&` somewhere. This pretty much never happens in Rust, or, well, other languages.
This is HN so usual disclaimer, it's not always proselytism to find one language's way of doing things more well-thought than another when twenty years of programming language research separate them.
- pjmlp 3y agoA rant that would be relevant, if concepts and constexpr did not exist.