▲ | pie_flavor 5 days ago | |
Fresh codebases have more bugs than mature codebases. Rewriting does not fix bugs; it is a fresh codebase that may have different bugs but extremely rarely fewer bugs than the codebase most of the bugs have been patched out of. Rewriting it in Rust reduces the bugs because Rust inherently prevents large categories of bugs. Rewriting it in C++ has no magical properties that initially writing it in C++ doesn't, especially if you weren't around for the writing of the original. Maybe if there is some especially persnickety known bug that would require a major rearchitecture and you plan to implement this architecture this time around, but that is not the modal bug, and the article is especially talking about memory safety bugs which are a totally separate kind of thing from that. | ||
▲ | Attrecomet 4 days ago | parent [-] | |
A rewrite of your C++0x codebase that's grown from 2009 until now will most definitely fix loads of memory bugs, since C++ has very much evolved in this area since then. The added value of the borrow checker compared with modern C++ is a lot less than compared with legacy C++. That said, I still think it's a rather weak argument, even if we do accept that the rewrite will do most of the bug removal, since we aren't stupid and move to smart pointers, more stl usage and for each loops. "Most" is not "all". |