Appreciating Rust’s Reliability in CLI Tool Development
I've spent years coding and creating various CLI tools to streamline my development workflow. Previously, most of these tools were developed in Ruby, and I often skipped testing them. This approach left me feeling like they were precarious, always on the verge of breaking due to unaccounted edge cases. However, since I started using Rust six months ago, my experience has dramatically improved.
Rust's design inherently pushes for more reliable code. It compels me to ensure values are defined before use. Initially, I relied heavily on unwrap(), but as my projects evolved, I began incorporating more robust error handling using anyhow & thiserror, replacing unwrap with fallback mechanisms. This shift in approach has been transformative.
I've ported around 30 CLI helpers to Rust, mainly for interacting with Git. The stability has been remarkable; none have failed unexpectedly after the initial few days of testing – a streak continuing for over six months. This reliability has been a game-changer for me.
Just wanted to share this positive experience with Rust!