6 points
*

“how to write sloppy rust code and squander most of the advantages of the language”

Only half serious. But I think really the only point that I agree with is taking the easy way out with the borrow checker. I mean, at least try to borrow when it’s idiomatic, but if you get frustrated, clone (or move) instead.

Error handling when done well is not much harder than unwrapping everything, and you get many advantages. Learn to use thiserror for your library crates and anyhow for executables.

I also agree that you should avoid unsafe 99% of the time. If you think you need it, you probably don’t.

permalink
report
reply
3 points

I see this post as an advice to learn gradually, and to write sloppy but painless code initially. Then when you have the basics, you can add the more idiomatic and tricky parts.

permalink
report
parent
reply

Rust

!rust@programming.dev

Create post

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits
  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

Community stats

  • 1

    Monthly active users

  • 398

    Posts

  • 396

    Comments