3 ms·
It's the type system. When people say a language is easier to refactor it's usually because the types are designed more like ML, with a little more formal rigor
by syntheweave 4y ago
It's the type system. When people say a language is easier to refactor it's usually because the types are designed more like ML, with a little more formal rigor, so the compiler errors can actually help you along as you make changes. Rust's model of mutability adds context to what you're doing - which is also what makes it hard at first(since it adds ceremony and constricts your initial design). In a large system where data can move through a lengthy code path with a lot of indirection, more nuance in types becomes a major advantage to your confidence in making changes.
C++ can never quite get there despite all the innovations made because of its descent from C style types, which are much more simplistic.