←back to thread

517 points bkolobara | 2 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. Isn0gud ◴[] No.45050061[source]
And then each time you refactor your code, your work doubled as you now also need to refactor your tests.
replies(1): >>45050155 #
2. amai ◴[] No.45050155[source]
If your tests are testing the structure of your code, then this is true. But if you test for functionality/features of your API then you can freely refactor below that layer of abstraction.