4 ms·
But most of the bugs I often face and seem to struggle with are with dynamic lifetimes (in graphics / simulation / gamedev). So even as a relatively low-level s
by cyber_kinetist 4y ago
But most of the bugs I often face and seem to struggle with are with dynamic lifetimes (in graphics / simulation / gamedev). So even as a relatively low-level systems dev I don’t really find Rust’s borrow checker that useful.
- insanitybit 4y agoI think there are cases where borrow checking is difficult for a domain, but without a lot more detail it's hard to say. My understanding is that graphics/gamedev is one of those cases and if you aren't willing to use ECS you may have problems.
- cyber_kinetist 4y agoI am personally using generational indices for a lot of my stuff, no smart pointers. Many ECS implementations also seem to use this technique. But if you're stuck with legacy code in $WORK you are stuck with raw/smart pointers and these really have lots of issues.
- nicoburns 4y agoI guess the benefit of Rust in this case is that you will get an index out of bounds error rather than Undefined Behaviour.
- cyber_kinetist 4y agoYou can also check index out of bounds in C++ code, and you actually have more freedom to control it in C++. In Rust bounds checks are required unless you use unsafe, in C++ you can turn it on/off freely depending on your usecase (for example, when you are in debug mode vs. deploying your code).