←back to thread

517 points bkolobara | 1 comments | | HN request time: 0s | source
Show context
amai ◴[] No.45049911[source]
"I have found that Rust's strong safety guarantees give me much more confidence when touching the codebase. With that extra confidence I'm much more willing to refactor even critical parts of the app, which has a very positive effect on my productivity, and long-term maintainability."

That is usually why you have tests for your code. But if you have no tests a programming language with a strict compiler is of course more helpful. But the best is to write tests. Then you can also refactor code with confidence written in "sloppy" programming languages.

replies(4): >>45049998 #>>45050001 #>>45050061 #>>45051630 #
1. lmm ◴[] No.45051630[source]
In my experience a Rust codebase with no tests warrants more confidence than any practical level of testing seen in sloppy programming languages, at least until you get to SQLite-style "10x as much test code as main code" projects. A decent type system lets you reach a given level of confidence at much lower cost than doing the same thing with tests. A decent type system plus a handful of judiciously chosen tests lets you reach a higher level than you would ever achieve with tests alone.