3 ms·
I guess Rust may seem more complex, if you know C++ well, but from the side it may not seem like it. For example, C++ Core Guidelines [0] is longer than Rust B
by nercury 10y ago
I guess Rust may seem more complex, if you know C++ well, but from the side it may not seem like it.
For example, C++ Core Guidelines [0] is longer than Rust Book. Core Guidelines is itself a great example of things one needs to keep in the head while writing C++ code.
Look at implementation of something as basic as optional<T> [1]. The amount of things one needs to know is so high most C++ developers would never attempt it.
[0]: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC...
[1]: https://github.com/akrzemi1/Optional/blob/master/optional.hpp https://github.com/akrzemi1/Optional/blob/master/optional.hp...
- girvo 10y agoWhich is interesting, because I implemented Optional<T> (well, Maybe<T>) in Nim v0.14 in 20 lines of code in a single evening, to see how difficult it would be!
- gpderetta 10y agoThe reason for the complexity of that implementation are compiler bugs/nonconfromance workarounds, a fully constexpr implementation and attempt to match a standard spec.
- girvo 10y ago> a fully constexpr implementation That's actually simpler to do in Nim than you'd think, but I understand what you mean. I might expand my implementation to be const and see how complex it makes it!
- soulbadguy 10y agoUsing the size difference between the C++ code Guidelines and the Rust Book as measure of relative complexity seems misguided to me : Those two very different document, with very different purpose and target audience.