←back to thread

451 points birdculture | 3 comments | | HN request time: 0.41s | source
1. nmeofthestate ◴[] No.43984878[source]
"You will have a much better time if you re-read your code to fix stupid typos before pressing “compile.”"

This is a strange one - I thought the rust compiler had famously helpful error messages, so why would I want to pore over my code looking for stupid typos when I can let the compiler find them for me? I am guaranteed to make stupid typos and want the computer to help me fix them.

replies(2): >>43984999 #>>43987820 #
2. steveklabnik ◴[] No.43984999[source]
cargo fix can automatically fix some, but not all, issues.
3. zahlman ◴[] No.43987820[source]
Because if you're "guaranteed to make stupid typos" and you don't have the habit of repeatedly trying again after small changes (which becomes harder to establish when compilation takes longer), then you're likely to make multiple stupid typos at a time. And if you check for them yourself first, you have a decent chance to catch and fix several at a time - whereas it's often not the brightest idea to try to respond to multiple compiler errors at a time, no matter how helpful they are.